/**
 * WooCommerce Order Received Page Styles
 *
 * Modern Redline Design - consistent with cart/checkout pages.
 *
 * @package MG_Red_Line
 * @version 3.0.0
 */

/* ========================================
   1. PAGE CONTAINER
   ======================================== */

.woocommerce-order-received,
.mgredline-order-received {
    background: var(--light-gray);
    min-height: 100vh;
}

.mgredline-order-received .container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

/* ========================================
   2. HIDE PROGRESS STEPS
   ======================================== */

.checkout-progress {
    display: none !important;
}

/* ========================================
   3. SUCCESS HEADER
   ======================================== */

.order-received-header {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2a2a2a 100%);
    border-radius: var(--border-radius-xl);
    padding: var(--space-2xl) var(--space-xl);
    margin-bottom: var(--space-md);
    text-align: center;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 32px rgba(0, 0, 0, 0.15);
}

.order-received-header .header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.order-received-header .success-icon {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-received-header .success-icon i {
    font-size: 4rem;
    color: #28a745;
    z-index: 2;
    position: relative;
}

.order-received-header .success-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: rgba(40, 167, 69, 0.2);
    border-radius: 50%;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.5; }
}

.order-received-header .header-text h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 var(--space-sm) 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.order-received-header .header-text p {
    font-family: var(--font-primary);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    max-width: 400px;
}

/* ========================================
   4. ORDER SUMMARY CARD
   ======================================== */

.order-summary-card {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: var(--space-2xl);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Order Header - Dark */
.order-summary-card .order-header {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2a2a2a 100%);
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.order-summary-card .order-header h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.order-summary-card .order-header h2 i {
    color: var(--primary-color);
}

.order-summary-card .order-number {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.order-summary-card .order-number .order-label {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

.order-summary-card .order-number .order-value {
    background: var(--primary-color);
    color: var(--white);
    padding: 6px 16px;
    border-radius: var(--border-radius-pill);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
}

/* Order Details Grid */
.order-details-grid {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* ========================================
   5. ORDER INFO SECTION
   ======================================== */

.order-info-section h3,
.order-items-section h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 var(--space-lg) 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--medium-gray);
    position: relative;
}

.order-info-section h3::after,
.order-items-section h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

.order-info-section h3 i,
.order-items-section h3 i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--light-gray);
    border-radius: var(--border-radius);
}

.info-item .info-label {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.info-item .info-value {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--dark-color);
}

.info-item .info-value.order-total {
    font-size: 1.1rem;
    color: var(--primary-color);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--border-radius-pill);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-completed {
    background: linear-gradient(135deg, #28a745, #218838);
    color: var(--white);
}

.status-badge.status-processing {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: var(--dark-color);
}

.status-badge.status-on-hold {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: var(--white);
}

.status-badge.status-pending {
    background: linear-gradient(135deg, #6c757d, #545b62);
    color: var(--white);
}

/* ========================================
   6. ORDER ITEMS SECTION
   ======================================== */

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.order-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--light-gray);
    border-radius: var(--border-radius);
    transition: background 0.2s ease;
}

.order-item:hover {
    background: rgba(220, 53, 69, 0.04);
}

.order-item .item-image {
    position: relative;
    flex-shrink: 0;
    overflow: visible;
    margin: 8px;
}

.order-item .item-image img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--border-radius);
    border: 1px solid var(--medium-gray);
}

.order-item .quantity-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    z-index: 10;
}

.order-item .item-details {
    flex: 1;
    min-width: 0;
}

.order-item .item-details h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 4px 0;
}

.order-item .item-meta {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.order-item .item-total {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

/* ========================================
   7. ORDER TOTALS SECTION
   ======================================== */

.order-totals-section {
    border-top: 1px solid var(--medium-gray);
    padding: var(--space-xl);
    margin-top: var(--space-md);
}

.order-totals-section h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 var(--space-lg) 0;
}

.totals-table {
    max-width: 350px;
    margin-left: auto;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--light-gray);
}

.total-row .total-label {
    font-family: var(--font-primary);
    color: var(--secondary-color);
}

.total-row .total-value {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--dark-color);
}

.total-row.grand-total {
    border-bottom: none;
    border-top: 2px solid var(--dark-color);
    margin-top: var(--space-sm);
    padding-top: var(--space-md);
    background: var(--light-gray);
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    border-radius: var(--border-radius);
}

.total-row.grand-total .total-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--dark-color);
}

.total-row.grand-total .total-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ========================================
   8. CUSTOMER DETAILS (ADDRESSES)
   ======================================== */

.customer-details-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-xl);
}

.address-section {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.address-section h3 {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2a2a2a 100%);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.address-section h3 i {
    color: var(--primary-color);
}

.address-section .address-content {
    padding: var(--space-lg);
    font-family: var(--font-primary);
    line-height: 1.8;
    color: var(--text-color);
}

/* ========================================
   9. NEXT STEPS SECTION
   ======================================== */

.next-steps-section {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: var(--space-xl);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.next-steps-section > h3,
.mgredline-order-received .next-steps-section h3 {
    background: linear-gradient(135deg, var(--dark-color) 0%, #2a2a2a 100%) !important;
    font-family: var(--font-heading) !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: var(--white) !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin: 0 !important;
    padding: var(--space-md) var(--space-lg) !important;
    display: flex !important;
    align-items: center !important;
    gap: var(--space-sm) !important;
}

.next-steps-section > h3 i {
    color: var(--primary-color);
}

.steps-list {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.step-item .step-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.step-item .step-icon i {
    color: var(--white);
    font-size: 1.1rem;
}

.step-item .step-content h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0 0 4px 0;
}

.step-item .step-content p {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin: 0;
    line-height: 1.5;
}

/* ========================================
   10. ACTION BUTTONS
   ======================================== */

.order-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    max-width: 400px;
    margin: 0 auto;
}

.order-actions .mgredline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--border-radius-lg);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
}

.order-actions .mgredline-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    color: var(--white);
    border: none;
    box-shadow:
        0 4px 16px rgba(220, 53, 69, 0.35),
        0 8px 32px rgba(220, 53, 69, 0.2);
}

.order-actions .mgredline-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 24px rgba(220, 53, 69, 0.45),
        0 16px 48px rgba(220, 53, 69, 0.25);
}

.order-actions .mgredline-btn-outline {
    background: var(--white);
    color: var(--dark-color);
    border: 2px solid var(--medium-gray);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.order-actions .mgredline-btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* ========================================
   11. ORDER ERROR STATE
   ======================================== */

.order-error {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: var(--space-3xl);
    text-align: center;
}

.order-error i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: var(--space-lg);
}

.order-error h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--dark-color);
    margin: 0 0 var(--space-md) 0;
}

.order-error p {
    color: var(--secondary-color);
    margin: 0 0 var(--space-xl) 0;
}

/* ========================================
   12. RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
    .mgredline-order-received .container {
        padding: var(--space-lg) var(--space-md);
    }

    .order-received-header {
        padding: var(--space-xl) var(--space-lg);
    }

    .order-received-header .header-text h1 {
        font-size: 1.5rem;
    }

    .order-summary-card .order-header {
        flex-direction: column;
        text-align: center;
        padding: var(--space-md);
    }

    .order-details-grid {
        padding: var(--space-lg);
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    .customer-details-wrapper {
        grid-template-columns: 1fr;
    }

    .order-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .order-actions .mgredline-btn {
        min-width: auto;
        width: 100%;
    }

    .totals-table {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .order-received-header {
        padding: var(--space-lg) var(--space-md);
        border-radius: var(--border-radius-lg);
    }

    .order-received-header .success-icon {
        width: 60px;
        height: 60px;
    }

    .order-received-header .success-icon i {
        font-size: 3rem;
    }

    .order-received-header .header-text h1 {
        font-size: 1.3rem;
        letter-spacing: 1px;
    }

    .order-received-header .header-text p {
        font-size: 0.9rem;
    }

    .order-item {
        flex-wrap: wrap;
    }

    .order-item .item-total {
        width: 100%;
        text-align: right;
        padding-top: var(--space-sm);
        border-top: 1px dashed var(--medium-gray);
        margin-top: var(--space-sm);
    }

    .step-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .step-item .step-icon {
        width: 56px;
        height: 56px;
    }

    .step-item .step-icon i {
        font-size: 1.3rem;
    }
}
