/* ========== BASE STYLES ========== */
.poh-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Search Container */
.poh-search-container {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 20px;
    position: relative;
}

.poh-search-input {
    width: 100%;
    padding: 14px 45px 14px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.poh-search-input:focus {
    border-color: #0071a1;
    outline: none;
    box-shadow: 0 2px 10px rgba(0,113,161,0.15);
}

.poh-search-clear {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    display: none;
}

.poh-search-input:not(:placeholder-shown) + .poh-search-clear {
    display: block;
}

.poh-no-results {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px;
    color: #6c757d;
    font-size: 16px;
    display: none;
}

/* Login required */
.poh-login-required {
    background: #f8f9fa;
    border-left: 4px solid #0071a1;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    text-align: center;
    color: #444;
    font-size: 16px;
}

.poh-login-required a {
    color: #0071a1;
    text-decoration: none;
    font-weight: 600;
}

.poh-login-required a:hover {
    text-decoration: underline;
}

/* Empty orders */
.poh-empty-orders {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    font-size: 18px;
}

/* ========== ORDER CARD ========== */
.poh-order-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
    overflow: hidden;
    margin-bottom: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.poh-order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Order header */
.poh-order-header {
    background: #f8f9fa;
    padding: 16px 24px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.poh-order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    width: 100%;
}

.poh-order-number {
    font-size: 16px;
    font-weight: 700;
    color: #2c3338;
    display: flex;
    align-items: center;
}

.poh-order-date {
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.poh-order-status {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}

.poh-status-completed {
    background: rgba(34, 160, 107, 0.12);
    color: #22a06b;
}

.poh-status-processing {
    background: rgba(26, 108, 188, 0.12);
    color: #1a6cbc;
}

.poh-status-on-hold {
    background: rgba(193, 87, 0, 0.12);
    color: #c15700;
}

.poh-status-cancelled {
    background: rgba(214, 54, 56, 0.12);
    color: #d63638;
}

.poh-order-total {
    font-weight: 700;
    color: #2c3338;
    font-size: 16px;
    margin-left: auto;
}

/* Order items */
.poh-order-items {
    padding: 0;
}

.poh-order-item {
    display: flex;
    padding: 15px 24px;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
}

.poh-order-item:last-child {
    border-bottom: none;
}

.poh-item-image {
    flex: 0 0 70px;
    margin-right: 15px;
}

.poh-item-image img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    background: #fff;
}

.poh-item-details {
    flex: 1;
}

.poh-item-name {
    margin: 0 0 6px;
    font-size: 15px;
    color: #2c3338;
    font-weight: 500;
    line-height: 1.4;
}

.poh-item-variation {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 6px;
    line-height: 1.4;
}

.poh-item-meta {
    display: flex;
    gap: 15px;
    color: #6c757d;
    font-size: 14px;
}

.poh-item-quantity, .poh-item-price {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.poh-item-price {
    color: #2c3338;
    font-weight: 600;
}

/* Order actions */
.poh-order-actions {
    padding: 15px 24px;
    border-top: 1px solid #eaeaea;
    display: flex;
    gap: 12px;
    background: #fafafa;
}

.poh-btn {
    padding: 11px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.5;
}

.poh-reorder-btn {
    background: #4caf50;
    color: white;
    flex: 1;
}

.poh-reorder-btn:hover {
    background: #3d8b40;
}

.poh-return-btn {
    background: #ff9800;
    color: white;
    flex: 1;
}

.poh-return-btn:hover {
    background: #e68a00;
}

/* ========== RETURN POPUP ========== */
.poh-return-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.poh-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}

.poh-popup-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.poh-popup-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    position: relative;
}

.poh-close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    line-height: 1;
    padding: 0;
}

.poh-close-popup:hover {
    background: #f5f5f5;
    color: #333;
}

.poh-popup-title {
    padding: 24px 24px 16px;
    margin: 0;
    font-size: 20px;
    color: #2c3338;
    font-weight: 700;
    border-bottom: 1px solid #eee;
}

.poh-return-products {
    padding: 15px 24px;
    max-height: 300px;
    overflow-y: auto;
}

.poh-return-item {
    display: flex;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
    align-items: center;
}

.poh-return-item:last-child {
    border-bottom: none;
}

.poh-return-item input[type="checkbox"] {
    margin-right: 16px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.poh-return-item label {
    display: flex;
    align-items: center;
    flex: 1;
    cursor: pointer;
}

.poh-return-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 16px;
    border-radius: 6px;
    border: 1px solid #eee;
    background: #fff;
}

.poh-return-details {
    flex: 1;
}

.poh-return-name {
    font-size: 16px;
    color: #2c3338;
    margin-bottom: 5px;
    font-weight: 500;
}

.poh-return-qty {
    font-size: 14px;
    color: #6c757d;
}

/* Form elements */
.poh-form-group {
    padding: 0 24px 16px;
}

.poh-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

.poh-form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.3s;
    font-family: inherit;
}

.poh-form-control:focus {
    border-color: #0071a1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,113,161,0.1);
}

.poh-textarea {
    min-height: 120px;
    resize: vertical;
}

.poh-form-actions {
    display: flex;
    gap: 15px;
    padding: 20px 24px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.poh-cancel-btn {
    background: #f0f0f0;
    color: #6c757d;
    flex: 1;
}

.poh-cancel-btn:hover {
    background: #e0e0e0;
}

.poh-primary-btn {
    background: #2196f3;
    color: white;
    flex: 1;
}

.poh-primary-btn:hover {
    background: #0b7dda;
}

/* ========== LOADER ========== */
.poh-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.poh-spinner {
    border: 4px solid rgba(0, 113, 161, 0.15);
    border-top: 4px solid #0071a1;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: poh-spin 1s linear infinite;
    margin-bottom: 20px;
}

.poh-loader-text {
    font-size: 16px;
    color: #444;
    font-weight: 500;
    max-width: 200px;
    text-align: center;
}

@keyframes poh-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 992px) {
    .poh-order-header {
        padding: 14px 20px;
    }
    
    .poh-order-meta {
        gap: 12px;
    }
    
    .poh-order-item {
        padding: 14px 20px;
    }
    
    .poh-item-image {
        flex: 0 0 60px;
        margin-right: 15px;
    }
    
    .poh-item-image img {
        width: 60px;
        height: 60px;
    }
    
    .poh-order-actions {
        padding: 14px 20px;
    }
}

@media (max-width: 768px) {
    .poh-container {
        padding: 15px;
    }
    
    .poh-search-container {
        padding: 0 15px;
    }
    
    .poh-order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .poh-order-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .poh-order-status, 
    .poh-order-total {
        margin-left: 0;
    }
    
    .poh-order-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px;
    }
    
    .poh-item-image {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .poh-item-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .poh-order-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .poh-btn {
        width: 100%;
    }
    
    .poh-popup-container {
        padding: 10px;
    }
    
    .poh-popup-content {
        max-height: 95vh;
    }
    
    .poh-return-products {
        max-height: 200px;
    }
    
    .poh-form-actions {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .poh-order-status {
        font-size: 12px;
        padding: 4px 12px;
    }
    
    .poh-popup-title {
        font-size: 18px;
        padding: 20px 20px 12px;
    }
    
    .poh-return-products {
        padding: 10px 20px;
    }
    
    .poh-form-group {
        padding: 0 20px 12px;
    }
    
    .poh-form-actions {
        padding: 16px 20px;
    }
    
    .poh-return-item {
        padding: 12px 0;
    }
    
    .poh-return-image {
        width: 50px;
        height: 50px;
    }
}