/* assets/css/order.css */

* {
    box-sizing: border-box;
}

:root {
    --lux-bg: #fbf7ef;
    --lux-card: #fffdf8;
    --lux-card-soft: #fff7ec;
    --lux-cream: #f8efe2;
    --lux-border: #e8d9c4;
    --lux-border-strong: #d6b98d;
    --lux-text: #18120d;
    --lux-heading: #080604;
    --lux-muted: #7b6c5b;
    --lux-brown: #5c3b18;
    --lux-brown-soft: #8b6a43;
    --lux-gold: #c58a22;
    --lux-gold-dark: #9b6415;
    --lux-green: #087a43;
    --lux-blue: #1e6bd6;
    --lux-orange: #d67b1e;
    --lux-red: #b3261e;
    --lux-black: #070707;
    --lux-shadow: 0 24px 70px rgba(70, 47, 22, .12);
    --lux-soft-shadow: 0 14px 36px rgba(70, 47, 22, .09);
    --lux-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
    --lux-transition: 220ms ease;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(219, 174, 101, .18), transparent 32%),
        radial-gradient(circle at 88% 18%, rgba(255, 244, 225, .85), transparent 38%),
        linear-gradient(135deg, #fffdf9 0%, var(--lux-bg) 48%, #f7efe5 100%);
    color: var(--lux-text);
    font-family: "Inter", "Montserrat", Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.lux-orders-page {
    min-height: 100vh;
    padding: 26px 32px 42px;
}

.orders-shell {
    max-width: 1760px;
    margin: 0 auto;
}

.orders-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(214, 185, 141, .56);
}

.orders-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 24px;
}

.orders-title-wrap h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 3.5vw, 58px);
    line-height: 1;
    font-weight: 500;
    letter-spacing: -1.3px;
    color: var(--lux-heading);
}

.orders-title-wrap span {
    font-size: 15px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--lux-brown-soft);
    font-weight: 800;
}

.orders-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.orders-search {
    min-height: 50px;
    width: min(420px, 34vw);
    border: 1px solid var(--lux-border);
    border-radius: 14px;
    background: rgba(255, 253, 248, .94);
    box-shadow: var(--lux-inner-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
    transition: var(--lux-transition);
}

.orders-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--lux-text);
}

.orders-search i {
    color: var(--lux-heading);
}

/* Custom Theme Dropdown */
.lux-select-wrap {
    position: relative;
    width: 185px;
    z-index: 20;
}

.lux-date-select {
    width: 170px;
}

.lux-native-select {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.lux-select-btn {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--lux-border);
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(255, 253, 248, .98), rgba(255, 247, 236, .98));
    color: var(--lux-heading);
    box-shadow: var(--lux-inner-shadow);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 900;
    text-align: left;
    transition: var(--lux-transition);
}

.lux-select-icon {
    color: var(--lux-heading);
    font-size: 15px;
    flex: 0 0 auto;
}

.lux-select-btn span[data-select-text] {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lux-select-arrow {
    color: var(--lux-heading);
    font-size: 12px;
    transition: var(--lux-transition);
}

.lux-select-wrap.open {
    z-index: 100;
}

.lux-select-wrap.open .lux-select-btn,
.lux-select-btn:hover,
.lux-select-btn:focus {
    border-color: var(--lux-border-strong);
    background: linear-gradient(145deg, #fffaf2, #fff1df);
    box-shadow: 0 12px 30px rgba(70, 47, 22, .12), var(--lux-inner-shadow);
    outline: 0;
}

.lux-select-wrap.open .lux-select-arrow {
    transform: rotate(180deg);
}

.lux-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    padding: 7px;
    border: 1px solid var(--lux-border-strong);
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(255, 253, 248, .99), rgba(255, 247, 236, .99));
    box-shadow: 0 22px 48px rgba(70, 47, 22, .18);
    display: grid;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.98);
    transform-origin: top;
    transition: 180ms ease;
    overflow: hidden;
}

.lux-select-wrap.open .lux-select-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lux-select-option {
    width: 100%;
    min-height: 38px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--lux-text);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 800;
    text-align: left;
    transition: var(--lux-transition);
}

.lux-select-option:hover {
    background: #fff1df;
    color: var(--lux-heading);
}

.lux-select-option.active {
    background: linear-gradient(135deg, #f8ead5, #fff4e4);
    color: var(--lux-heading);
    box-shadow: inset 0 0 0 1px rgba(214, 185, 141, .65);
}

.orders-search:hover,
.orders-search:focus-within {
    border-color: var(--lux-border-strong);
    background: #fffaf2;
    box-shadow: 0 12px 30px rgba(70, 47, 22, .10), var(--lux-inner-shadow);
}

.orders-list {
    display: grid;
    gap: 14px;
    padding-top: 24px;
}

.order-accordion {
    border: 1px solid rgba(232, 217, 196, .92);
    border-radius: 18px;
    background: rgba(255, 253, 248, .82);
    box-shadow: var(--lux-soft-shadow);
    backdrop-filter: blur(14px);
    overflow: hidden;
    transition: var(--lux-transition);
}

.order-accordion.open {
    border-color: rgba(214, 185, 141, .95);
    box-shadow: var(--lux-shadow);
}

.order-summary-row {
    width: 100%;
    min-height: 78px;
    padding: 15px 20px;
    border: 0;
    background: transparent;
    display: grid;
    grid-template-columns:
        36px
        52px
        minmax(230px, 1.5fr)
        minmax(150px, .9fr)
        minmax(150px, .9fr)
        minmax(140px, .75fr)
        minmax(170px, .8fr);
    align-items: center;
    gap: 16px;
    text-align: left;
    color: var(--lux-text);
    cursor: pointer;
}

.order-summary-row:focus {
    outline: 2px solid rgba(197, 138, 34, .35);
    outline-offset: -3px;
}

.order-arrow {
    display: grid;
    place-items: center;
    color: var(--lux-heading);
}

.order-arrow i {
    transition: var(--lux-transition);
}

.order-accordion.open .order-arrow i {
    transform: rotate(90deg);
}

.order-icon,
.info-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff8ef, #ead8c2);
    border: 1px solid var(--lux-border);
    color: var(--lux-brown);
    display: grid;
    place-items: center;
    box-shadow: var(--lux-inner-shadow);
}

.order-code-wrap,
.order-status-wrap,
.payment-status-wrap,
.order-total-wrap {
    display: grid;
    gap: 5px;
}

.order-code-wrap strong {
    font-size: 18px;
    color: var(--lux-heading);
}

.order-code-wrap small,
.order-summary-row small {
    font-size: 13px;
    color: var(--lux-muted);
}

.order-total-wrap strong {
    font-size: 24px;
    color: var(--lux-heading);
    letter-spacing: -.5px;
}

.order-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.status-badge {
    width: fit-content;
    min-height: 28px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    border: 1px solid transparent;
}

.status-delivered,
.payment-paid {
    background: #e5f4eb;
    color: var(--lux-green);
    border-color: #c7e7d3;
}

.status-shipped {
    background: #e7f0ff;
    color: var(--lux-blue);
    border-color: #caddff;
}

.status-processing,
.payment-pending {
    background: #fff1df;
    color: var(--lux-orange);
    border-color: #f4d2a7;
}

.status-cancelled {
    background: #fff0ee;
    color: var(--lux-red);
    border-color: #f0c6c1;
}

.payment-refunded {
    background: #f0eee9;
    color: #5f5650;
    border-color: #ddd6cd;
}

.order-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 450ms ease;
}

.order-accordion.open .order-details {
    max-height: 2200px;
}

.order-info-grid {
    margin: 0 20px 0;
    padding: 20px 0;
    border-top: 1px solid var(--lux-border);
    display: grid;
    grid-template-columns: 1fr 1.55fr 1fr 1.15fr;
    gap: 18px;
}

.order-info-box {
    display: flex;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(232, 217, 196, .76);
    border-radius: 17px;
    background: rgba(255, 250, 243, .58);
}

.order-info-box h4 {
    margin: 0 0 8px;
    color: var(--lux-heading);
    font-size: 15px;
}

.order-info-box p {
    margin: 0 0 6px;
    color: #51483f;
    font-size: 14px;
    line-height: 1.48;
}

.order-mini-summary div div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    font-size: 14px;
    margin-bottom: 5px;
}

.order-mini-summary span {
    color: var(--lux-muted);
}

.order-mini-summary b {
    color: var(--lux-heading);
}

.order-products-table-wrap {
    margin: 0 20px 20px;
    border: 1px solid var(--lux-border);
    border-radius: 16px;
    overflow: auto;
    background: rgba(255, 255, 255, .64);
}

.order-products-table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
}

.order-products-table th,
.order-products-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--lux-border);
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
}

.order-products-table th {
    background: #fff7ec;
    color: #6a512e;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.order-products-table tr:last-child td {
    border-bottom: 0;
}

.ordered-product,
.modal-product {
    display: flex;
    align-items: center;
    gap: 13px;
}

.ordered-product img,
.modal-product img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: contain;
    background: linear-gradient(145deg, #fff8ef, #ead8c2);
    border: 1px solid var(--lux-border);
    padding: 5px;
}

.ordered-product strong,
.modal-product strong {
    display: block;
    color: var(--lux-heading);
    margin-bottom: 4px;
}

.ordered-product small,
.modal-product small {
    color: var(--lux-muted);
}

.bill-btn,
.view-order-btn {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 900;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.bill-btn {
    border: 1px solid var(--lux-border-strong);
    background: #fffaf2;
    color: var(--lux-heading);
}

.view-order-btn {
    border: 0;
    background: var(--lux-black);
    color: #fff;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .18);
}

.view-order-btn:hover,
.bill-btn:hover {
    transform: translateY(-2px);
    transition: var(--lux-transition);
}

.order-modal[hidden] {
    display: none !important;
}

.order-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: center;
    padding: 22px;
}

.order-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 18, 13, .62);
    backdrop-filter: blur(8px);
}

.order-modal-box {
    position: relative;
    z-index: 2;
    width: min(1080px, 94vw);
    max-height: 88vh;
    overflow: hidden;
    border: 1px solid var(--lux-border-strong);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 253, 248, .99), rgba(255, 246, 232, .99));
    box-shadow: 0 36px 100px rgba(0, 0, 0, .34);
    animation: modalIn 260ms ease both;
}

.order-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--lux-border);
    background: #fff;
    color: var(--lux-heading);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}

.order-modal-content {
    max-height: 88vh;
    overflow: auto;
    padding: 28px;
}

.modal-order-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-right: 44px;
}

.modal-kicker {
    color: var(--lux-brown-soft);
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: 12px;
    font-weight: 900;
}

.modal-order-head h2 {
    margin: 7px 0 5px;
    font-family: Georgia, serif;
    font-size: 34px;
    font-weight: 500;
    color: var(--lux-heading);
}

.modal-order-head p {
    margin: 0;
    color: var(--lux-muted);
}

.modal-total {
    padding: 16px 20px;
    border-radius: 16px;
    background: #f8ead5;
    text-align: right;
}

.modal-total span {
    display: block;
    color: var(--lux-muted);
    font-size: 13px;
    margin-bottom: 6px;
}

.modal-total strong {
    font-size: 28px;
    color: var(--lux-heading);
}

.modal-badges {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.modal-info-grid > div {
    border: 1px solid var(--lux-border);
    border-radius: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, .58);
}

.modal-info-grid h4 {
    margin: 0 0 10px;
    color: var(--lux-heading);
}

.modal-info-grid p {
    margin: 0 0 7px;
    color: #51483f;
    font-size: 14px;
    line-height: 1.5;
}

.modal-products-wrap {
    border: 1px solid var(--lux-border);
    border-radius: 16px;
    overflow: auto;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1200px) {
    .orders-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .orders-tools {
        width: 100%;
    }

    .orders-search {
        width: 100%;
        flex: 1;
    }

    .lux-select-wrap,
    .lux-date-select {
        flex: 1;
        min-width: 180px;
    }

    .order-summary-row {
        grid-template-columns:
            32px
            50px
            minmax(180px, 1.4fr)
            minmax(120px, .8fr)
            minmax(120px, .8fr)
            minmax(120px, .7fr)
            minmax(150px, .8fr);
        gap: 10px;
    }

    .order-info-grid,
    .modal-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bill-btn,
    .view-order-btn {
        padding: 0 14px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .lux-orders-page {
        padding: 0 10px 28px;
    }

    .orders-topbar {
        position: sticky;
        top: 0;
        z-index: 50;
        padding: 15px 6px;
        background: rgba(255, 253, 248, .94);
        backdrop-filter: blur(14px);
    }

    .orders-title-wrap h1 {
        font-size: 31px;
    }

    .orders-title-wrap span {
        display: none;
    }

    .orders-tools {
        flex-direction: column;
    }

    .orders-search,
    .lux-select-wrap,
    .lux-date-select {
        width: 100%;
        min-width: 100%;
    }

    .order-summary-row {
        grid-template-columns: 26px 42px 1fr;
        padding: 14px;
    }

    .order-status-wrap,
    .payment-status-wrap {
        grid-column: 3 / 4;
        display: inline-flex;
        flex-direction: row;
        gap: 9px;
        align-items: center;
    }

    .order-total-wrap {
        grid-column: 3 / 4;
    }

    .order-row-actions {
        grid-column: 1 / 4;
        justify-content: stretch;
        padding-top: 4px;
    }

    .order-row-actions .bill-btn,
    .order-row-actions .view-order-btn {
        width: 100%;
    }

    .order-info-grid,
    .modal-info-grid {
        grid-template-columns: 1fr;
        margin: 0 14px;
    }

    .order-products-table-wrap {
        margin: 0 14px 18px;
    }

    .order-modal {
        padding: 10px;
    }

    .order-modal-box {
        width: 100%;
        max-height: 90vh;
        border-radius: 18px;
    }

    .order-modal-content {
        padding: 20px 14px;
    }

    .modal-order-head {
        flex-direction: column;
        padding-right: 48px;
    }

    .modal-total {
        width: 100%;
        text-align: left;
    }
}