/**
 * Modeo Account - View Order Details
 * 
 * Premium styles for single order view
 */

/* ========================================
   VIEW ORDER WRAPPER
   ======================================== */

.modeo-view-order {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ========================================
   ORDER HEADER
   ======================================== */

.order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(204, 22, 22, 0.04) 0%, rgba(248, 113, 113, 0.02) 100%);
    border-radius: 16px;
    border: 1px solid rgba(204, 22, 22, 0.1);
}

.order-header-content .section-heading {
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.order-header-content .section-heading .material-icons {
    color: #cc1616;
    font-size: 28px;
}

.order-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #6b7280;
    font-size: 0.9rem;
}

.order-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-date .material-icons {
    font-size: 18px;
    color: #cc1616;
}

.order-status {
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Colors */
.status-completed {
    background: rgba(39, 174, 96, 0.12);
    color: #27ae60;
}

.status-processing {
    background: rgba(204, 22, 22, 0.1);
    color: #cc1616;
}

.status-on-hold {
    background: rgba(243, 156, 18, 0.12);
    color: #d68910;
}

.status-pending {
    background: rgba(127, 140, 141, 0.12);
    color: #5d6d7e;
}

.status-cancelled,
.status-refunded,
.status-failed {
    background: rgba(231, 76, 60, 0.12);
    color: #c0392b;
}

/* Order Actions */
.order-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modeo-button-back-to-orders {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: #cc1616;
    border: 2px solid #cc1616;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.modeo-button-back-to-orders:hover {
    background: #cc1616;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 22, 22, 0.25);
}

.modeo-button-back-to-orders .material-icons {
    font-size: 18px;
}

/* Order Description */
.order-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #6b7280;
    background: #f9fafb;
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid #cc1616;
    margin: 0;
}

.order-description mark {
    background: transparent;
    font-weight: 600;
    color: #cc1616;
}

/* ========================================
   ORDER DETAILS GRID
   ======================================== */

.order-details-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
}

@media (max-width: 991px) {
    .order-details-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ========================================
   ORDER ITEMS SECTION
   ======================================== */

.order-items-section {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 24px;
}

.order-items-section .woocommerce-order-details__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(204, 22, 22, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Order Items Table */
.order-items-section .shop_table {
    width: 100%;
    border-collapse: collapse;
}

.order-items-section .shop_table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
    border-bottom: 1px solid #f0f0f0;
}

.order-items-section .shop_table thead th:first-child {
    border-radius: 8px 0 0 8px;
}

.order-items-section .shop_table thead th:last-child {
    border-radius: 0 8px 8px 0;
    text-align: right;
}

.order-items-section .shop_table tbody td {
    padding: 16px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.order-items-section .shop_table tbody tr:last-child td {
    border-bottom: none;
}

.order-items-section .shop_table tbody td.product-name {
    font-weight: 600;
    color: #1f2937;
}

.order-items-section .shop_table tbody td.product-name a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.order-items-section .shop_table tbody td.product-name a:hover {
    color: #cc1616;
}

.order-items-section .shop_table tbody td.product-total {
    text-align: right;
    font-weight: 700;
    color: #1f2937;
}

/* Product thumbnail in table */
.order-items-section .shop_table .product-thumbnail {
    width: 60px;
}

.order-items-section .shop_table .product-thumbnail img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

/* ========================================
   ORDER SIDEBAR
   ======================================== */

.order-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Order Totals */
.modeo-order-totals,
.modeo-order-totals--sticky {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modeo-order-totals--sticky {
    position: sticky;
    top: 100px;
}

@media (max-width: 991px) {
    .modeo-order-totals--sticky {
        position: static;
    }
}

.modeo-order-totals h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(204, 22, 22, 0.08);
}

.modeo-order-totals-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modeo-order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.modeo-order-total-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.modeo-order-total-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.modeo-order-total-row--final {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 2px solid #f0f0f0;
}

.modeo-order-total-row--final .modeo-order-total-label {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.modeo-order-total-row--final .modeo-order-total-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #cc1616;
}

/* Order Note */
.modeo-order-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(204, 22, 22, 0.04);
    border-radius: 10px;
    border-left: 3px solid #cc1616;
}

.modeo-order-note strong {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #cc1616;
}

.modeo-order-note p {
    margin: 6px 0 0 0;
    font-size: 0.875rem;
    color: #1f2937;
    line-height: 1.5;
}

/* ========================================
   CUSTOMER DETAILS SECTION
   ======================================== */

.customer-details-section {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 24px;
}

.customer-details-section h2,
.customer-details-section .woocommerce-column__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(204, 22, 22, 0.08);
    display: flex;
    gap: 4px;
}

.customer-details-section address {
    font-style: normal;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #4b5563;
}

.customer-details-section address p {
    margin: 0;
}

/* Addresses Grid - Stacked Layout */
.woocommerce-columns--addresses {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.woocommerce-column--billing-address,
.woocommerce-column--shipping-address {
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 767px) {
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .order-header-content .section-heading {
        font-size: 1.25rem;
    }

    .order-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .order-actions {
        width: 100%;
    }

    .modeo-button-back-to-orders {
        width: 100%;
        justify-content: center;
    }

    .order-items-section,
    .customer-details-section,
    .modeo-order-totals {
        padding: 16px;
    }

    /* Mobile table layout */
    .order-items-section .shop_table thead {
        display: none;
    }

    .order-items-section .shop_table tbody tr {
        display: block;
        border-bottom: 2px solid #f5f5f5;
        padding: 16px 0;
    }

    .order-items-section .shop_table tbody tr:last-child {
        border-bottom: none;
    }

    .order-items-section .shop_table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none;
    }

    .order-items-section .shop_table tbody td::before {
        content: attr(data-title);
        font-weight: 600;
        color: #6b7280;
        font-size: 0.8125rem;
    }

    .order-items-section .shop_table tbody td.product-total {
        text-align: right;
    }
}