/**
 * Order Documents - Minimal CSS
 * Clean, professional design for WooCommerce order pages
 */

/* ========================================
   ORDER VIEW PAGE - Header
   ======================================== */
.woocommerce-order > p:first-of-type {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.woocommerce-order > p:first-of-type mark {
    background: none;
    padding: 0;
}

.woocommerce-order > p:first-of-type mark.order-number {
    font-weight: 700;
    color: #1f2937;
}

.woocommerce-order > p:first-of-type mark.order-date {
    font-weight: 500;
    color: #374151;
}

.woocommerce-order > p:first-of-type mark.order-status {
    display: inline-block;
    padding: 2px 10px;
    background: #fef3c7;
    color: #b45309;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Status colors */
.woocommerce-order--status-completed > p:first-of-type mark.order-status,
.woocommerce-order--status-processing > p:first-of-type mark.order-status {
    background: #d1fae5;
    color: #059669;
}

.woocommerce-order--status-cancelled > p:first-of-type mark.order-status,
.woocommerce-order--status-failed > p:first-of-type mark.order-status {
    background: #fee2e2;
    color: #dc2626;
}

/* ========================================
   ORDER DETAILS SECTION
   ======================================== */
.woocommerce-order-details {
    margin-bottom: 32px;
}

.woocommerce-order-details__title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

/* Order table */
.woocommerce-table--order-details {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.woocommerce-table--order-details thead th {
    background: #f9fafb;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.woocommerce-table--order-details tbody td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.woocommerce-table--order-details tbody tr:last-child td {
    border-bottom: none;
}

/* Product total price */
.woocommerce-table--order-details .product-total {
    font-weight: 600;
    color: #059669;
    font-size: 15px;
    text-align: right;
}

/* Footer totals */
.woocommerce-table--order-details tfoot {
    background: #f9fafb;
}

.woocommerce-table--order-details tfoot th,
.woocommerce-table--order-details tfoot td {
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
}

.woocommerce-table--order-details tfoot th {
    font-weight: 500;
    color: #6b7280;
    text-align: left;
}

.woocommerce-table--order-details tfoot td {
    text-align: right;
    color: #1f2937;
}

.woocommerce-table--order-details tfoot tr:last-of-type th,
.woocommerce-table--order-details tfoot tr:last-of-type td {
    font-weight: 700;
    font-size: 16px;
    color: #1f2937;
    background: #f3f4f6;
}

.woocommerce-table--order-details tfoot tr:last-of-type td .woocommerce-Price-amount {
    color: #059669;
}

/* Hide duplicate WooCommerce product meta */
.woocommerce-table--order-details .product-quantity,
.woocommerce-table--order-details .wd-product-detail {
    display: none;
}

/* ========================================
   SHIPMENT INFO BOX
   ======================================== */
.asm-shipment-info {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
}

.asm-shipment-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.asm-shipment-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.asm-shipment-col {
    flex: 1;
    min-width: 200px;
}

.asm-shipment-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.asm-shipment-value {
    font-size: 14px;
    color: #1f2937;
}

.asm-shipment-value a {
    color: #3fa62c;
    text-decoration: none;
}

.asm-shipment-value a:hover {
    text-decoration: underline;
}

/* Document buttons */
.asm-shipment-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.asm-doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s;
}

.asm-doc-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.asm-doc-btn svg {
    flex-shrink: 0;
}

/* Notes accordion */
.asm-shipment-notes-accordion {
    margin-top: 16px;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.asm-notes-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.asm-notes-toggle-arrow {
    transition: transform 0.2s;
}

.asm-shipment-notes-accordion.open .asm-notes-toggle-arrow {
    transform: rotate(180deg);
}

.asm-notes-content {
    display: none;
    margin-top: 8px;
    background: #f9fafb;
    border-radius: 6px;
    overflow: hidden;
}

.asm-shipment-notes-accordion.open .asm-notes-content {
    display: block;
}

.asm-note-log-entry {
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}

.asm-note-log-entry:last-child {
    border-bottom: none;
}

.asm-note-log-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.asm-note-log-text {
    color: #374151;
    line-height: 1.4;
}

/* ========================================
   SHIPMENT ROW - Tracking & Delivery
   ======================================== */
.asm-shipment-tracking,
.asm-shipment-delivery {
    flex: 1;
    min-width: 180px;
}

.asm-ship-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
}

.asm-ship-label svg {
    color: #9ca3af;
}

.asm-ship-value {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #1f2937;
}

.asm-ship-value code {
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 13px;
    color: #374151;
}

.asm-ship-value strong {
    font-weight: 600;
}

.asm-track-link {
    color: #3fa62c;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.asm-track-link:hover {
    text-decoration: underline;
}

/* ========================================
   CUSTOMER DETAILS - Addresses
   ======================================== */
.woocommerce-customer-details {
    margin-top: 32px;
}

.woocommerce-columns--addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.woocommerce-customer-details .woocommerce-column--billing-address,
.woocommerce-customer-details .woocommerce-column--shipping-address,
.woocommerce-customer-details .woocommerce-column {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 20px !important;
}

.woocommerce-column__title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.woocommerce-customer-details address {
    font-style: normal;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.woocommerce-customer-details--phone,
.woocommerce-customer-details--email {
    margin: 8px 0 0;
    font-size: 13px;
}

.woocommerce-customer-details--phone::before {
    content: "📞 ";
}

.woocommerce-customer-details--email::before {
    content: "✉️ ";
}

/* ========================================
   MOBILE NAVIGATION ACCORDION
   ======================================== */
@media (max-width: 768px) {
    .asm-mobile-nav-accordion {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin: 0 0 16px;
        overflow: hidden;
    }
    
    .asm-mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 16px;
        background: #fff;
        border: none;
        cursor: pointer;
        font-size: 14px;
        color: #1f2937;
    }
    
    .asm-mobile-nav-toggle-text {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 500;
    }
    
    .asm-mobile-nav-toggle-icon {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #3fa62c;
        border-radius: 6px;
        color: #fff;
    }
    
    .asm-mobile-nav-toggle-arrow {
        color: #9ca3af;
        transition: transform 0.2s;
    }
    
    .asm-mobile-nav-accordion.open .asm-mobile-nav-toggle-arrow {
        transform: rotate(180deg);
    }
    
    .asm-mobile-nav-content {
        display: none;
        border-top: 1px solid #e5e7eb;
    }
    
    .asm-mobile-nav-accordion.open .asm-mobile-nav-content {
        display: block;
    }
    
    /* Nav items - simple list */
    .asm-mobile-nav-content .wd-nav-my-acc {
        display: flex !important;
        flex-direction: column !important;
        padding: 8px !important;
        gap: 2px !important;
    }
    
    .asm-mobile-nav-content .wd-nav-my-acc li {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .asm-mobile-nav-content .wd-nav-my-acc li a {
        display: flex !important;
        align-items: center !important;
        padding: 10px 12px !important;
        font-size: 14px !important;
        color: #374151 !important;
        text-decoration: none !important;
        border-radius: 6px !important;
        background: transparent !important;
    }
    
    .asm-mobile-nav-content .wd-nav-my-acc li a:hover {
        background: #f3f4f6 !important;
    }
    
    .asm-mobile-nav-content .wd-nav-my-acc li.wd-active a {
        background: #ecfdf5 !important;
        color: #059669 !important;
        font-weight: 500 !important;
    }
    
    /* Hide icons in nav */
    .asm-mobile-nav-content .wd-nav-my-acc .wd-nav-icon {
        display: none !important;
    }
    
    /* Logout */
    .asm-mobile-nav-content .wd-nav-my-acc li.woocommerce-MyAccount-navigation-link--customer-logout a {
        color: #dc2626 !important;
    }
    
    /* Hide original Woodmart header */
    .elementor-element[data-id="f909ec4"] {
        display: none !important;
    }
    
    /* Hide title wrapper */
    .asm-mobile-nav-content .title-wrapper {
        display: none !important;
    }
    
    /* Shipment info responsive */
    .asm-shipment-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .asm-doc-btn {
        flex: 1;
        justify-content: center;
    }
    
    /* Addresses responsive */
    .woocommerce-columns--addresses {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Order table mobile */
    .woocommerce-table--order-details thead {
        display: none;
    }
    
    .woocommerce-table--order-details tbody tr {
        display: block;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .woocommerce-table--order-details tbody td {
        display: block;
        padding: 0;
        border: none;
    }
    
    .woocommerce-table--order-details tbody td.product-total {
        margin-top: 12px;
        text-align: left;
        font-size: 16px;
    }
    
    .woocommerce-table--order-details tfoot tr {
        display: flex;
        justify-content: space-between;
        padding: 10px 16px;
    }
    
    .woocommerce-table--order-details tfoot th,
    .woocommerce-table--order-details tfoot td {
        padding: 0;
        border: none;
        background: transparent !important;
    }
}

/* ========================================
   PRODUCT ROW IN ORDER DETAILS
   ======================================== */
.asm-order-product-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.asm-order-product-thumb {
    flex-shrink: 0;
}

.asm-order-product-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.asm-order-product-info {
    flex: 1;
    min-width: 0;
}

.asm-order-product-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
    display: block;
}

.asm-order-product-name:hover {
    color: #3fa62c;
}

.asm-order-product-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

/* Same address message */
.asm-same-address {
    color: #059669;
    font-style: italic;
}

/* ========================================
   ORDER HEADER (number, date, status)
   ======================================== */
@media (max-width: 768px) {
    .woocommerce-order > p:first-of-type {
        font-size: 14px;
        line-height: 1.6;
        color: #374151;
    }
    
    .woocommerce-order > p:first-of-type mark {
        background: none;
        padding: 0;
    }
    
    .woocommerce-order > p:first-of-type mark.order-number {
        font-weight: 600;
        color: #1f2937;
    }
    
    .woocommerce-order > p:first-of-type mark.order-date {
        font-weight: 500;
        color: #374151;
    }
    
    .woocommerce-order > p:first-of-type mark.order-status {
        font-weight: 600;
        color: #059669;
    }
}

/* ========================================
   MOBILE ORDER TABLE
   ======================================== */
@media (max-width: 768px) {
    /* Orders list table - card style */
    .woocommerce-orders-table.my_account_orders {
        border: none;
        background: transparent;
    }
    
    .woocommerce-orders-table.my_account_orders thead {
        display: none;
    }
    
    .woocommerce-orders-table.my_account_orders tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .woocommerce-orders-table.my_account_orders tbody td,
    .woocommerce-orders-table.my_account_orders tbody th {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border: none;
    }
    
    .woocommerce-orders-table.my_account_orders tbody td::before,
    .woocommerce-orders-table.my_account_orders tbody th::before {
        content: attr(data-title);
        font-weight: 500;
        color: #6b7280;
        font-size: 13px;
    }
    
    .woocommerce-orders-table__cell-order-actions {
        margin-top: 12px;
        padding-top: 12px !important;
        border-top: 1px solid #e5e7eb !important;
    }
    
    .woocommerce-orders-table__cell-order-actions::before {
        display: none !important;
    }
    
    .woocommerce-orders-table__cell-order-actions .button {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        background: #3fa62c;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
    }
}
