/* ===== ORDERS PAGE STYLES ===== */

:root {
    --cream: #F7EFE1;
    --cream-dark: #EFE1C8;
    --ink: #2B2320;
    --ink-soft: #5B4E44;
    --rust: #B5502D;
    --rust-dark: #8F3D20;
    --gold: #D9A441;
    --green: #47614A;
    --board: #2E3B2E;
    --board-light: #3C4C3C;
    --white-ghost: #F8F8FF;
    --display: 'Fraunces', serif;
    --body: 'Manrope', sans-serif;
    --chalk: 'Caveat', cursive;
    --radius: 22px;
    --radius-sm: 12px;
    --shadow: 0 18px 40px -18px rgba(43,35,32,0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--display);
    background: var(--cream);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

.amp {
    color: var(--gold);
    font-weight: 700;
}

ul {
    list-style: none;
}

/* ===== HEADER STYLES REMOVED - USING STYLE.CSS ===== */

/* ===== NOT LOGGED IN ===== */
.not-logged-in {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-required {
    max-width: 500px;
    text-align: center;
    padding: 60px 40px;
    background: var(--white-ghost);
    border-radius: var(--radius);
}

.lock-icon {
    width: 100px;
    height: 100px;
    background: var(--cream-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.lock-icon i {
    font-size: 48px;
    color: var(--ink-soft);
}

.auth-required h1 {
    font-family: var(--display);
    font-size: 24px;
    font-weight: 700;
    color: var(--board);
    margin-bottom: 8px;
}

.auth-required p {
    font-family: var(--body);
    font-size: 15px;
    color: var(--ink-soft);
    margin-bottom: 32px;
}

.auth-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-family: var(--body);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--board);
    color: var(--cream);
}

.btn-primary:hover {
    background: var(--gold);
    color: var(--board);
}

.btn-secondary {
    background: var(--gold);
    color: var(--board);
}

.btn-secondary:hover {
    background: var(--rust);
    color: var(--cream);
}

/* ===== ORDERS PAGE ===== */
.orders-page {
    margin-top: 90px;
    padding: 40px 20px 60px;
    flex: 1;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-family: var(--display);
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 700;
    color: var(--board);
    margin-bottom: 8px;
}

.page-header p {
    font-family: var(--body);
    font-size: 15px;
    color: var(--ink-soft);
}

/* ===== ORDERS STATS ===== */
.orders-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white-ghost);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(43, 35, 32, 0.08);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: var(--board);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 24px;
    color: var(--gold);
}

.stat-icon.active {
    background: var(--gold);
}

.stat-icon.active i {
    color: var(--board);
}

.stat-icon.completed {
    background: var(--green);
}

.stat-icon.completed i {
    color: var(--cream);
}

.stat-value {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 700;
    color: var(--board);
    display: block;
}

.stat-label {
    font-family: var(--body);
    font-size: 13px;
    color: var(--ink-soft);
}

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--cream-dark);
    padding: 8px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--body);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn.active {
    background: var(--board);
    color: var(--cream);
}

.tab-btn:hover:not(.active) {
    background: var(--white-ghost);
    color: var(--board);
}

/* ===== LOADING & EMPTY STATES ===== */
.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(217, 164, 65, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state p {
    font-family: var(--body);
    font-size: 15px;
    color: var(--ink-soft);
}

.empty-icon {
    width: 100px;
    height: 100px;
    background: var(--cream-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.empty-icon i {
    font-size: 48px;
    color: var(--ink-soft);
}

.empty-state h2 {
    font-family: var(--display);
    font-size: 24px;
    color: var(--board);
    margin-bottom: 8px;
}

.empty-state p {
    font-family: var(--body);
    font-size: 15px;
    color: var(--ink-soft);
    margin-bottom: 24px;
}

.btn-browse {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--board);
    color: var(--cream);
    border-radius: var(--radius-sm);
    font-family: var(--body);
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-browse:hover {
    background: var(--gold);
    color: var(--board);
}

/* ===== ORDERS LIST ===== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card {
    background: var(--white-ghost);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 16px rgba(43, 35, 32, 0.06);
    cursor: pointer;
    transition: all 0.3s;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.order-id {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 600;
    color: var(--board);
}

.order-date {
    font-family: var(--body);
    font-size: 13px;
    color: var(--ink-soft);
}

.order-status {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-status.pending {
    background: #FEF3C7;
    color: #92400E;
}

.order-status.preparing,
.order-status.accepted {
    background: #DBEAFE;
    color: #1E40AF;
}

.order-status.out_for_delivery {
    background: #E0E7FF;
    color: #4338CA;
}

.order-status.delivered {
    background: #D1FAE5;
    color: #065F46;
}

.order-status.cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

.order-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
}

.order-items-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--ink-soft);
}

.item-preview span {
    color: var(--board);
    font-weight: 500;
}

.order-total-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.order-total-label {
    font-family: var(--body);
    font-size: 12px;
    color: var(--ink-soft);
}

.order-total-amount {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(43, 35, 32, 0.08);
    flex-wrap: wrap;
    gap: 12px;
}

.order-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ink-soft);
}

.order-type i {
    color: var(--gold);
}

.view-details-btn {
    padding: 8px 16px;
    background: var(--board);
    color: var(--cream);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.view-details-btn:hover {
    background: var(--gold);
}

/* ===== ORDER MODAL ===== */
.order-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.order-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(43, 35, 32, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--white-ghost);
    border-radius: var(--radius);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid rgba(43, 35, 32, 0.08);
}

.modal-header h2 {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 600;
    color: var(--board);
}

.modal-close {
    width: 40px;
    height: 40px;
    background: var(--board);
    border: none;
    border-radius: 50%;
    color: var(--cream);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.modal-close:hover {
    background: var(--rust);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-body > div h3 {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 600;
    color: var(--board);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body > div h3 i {
    color: var(--gold);
}

/* Status Timeline */
.status-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 20px 0;
}

.status-timeline::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(43, 35, 32, 0.1);
}

.status-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.status-step .step-dot {
    width: 12px;
    height: 12px;
    background: rgba(43, 35, 32, 0.2);
    border-radius: 50%;
    border: 2px solid var(--cream);
    transition: all 0.3s;
}

.status-step.active .step-dot {
    background: var(--gold);
    border-color: var(--gold);
}

.status-step.completed .step-dot {
    background: var(--green);
    border-color: var(--green);
}

.status-step span {
    font-size: 11px;
    color: var(--ink-soft);
    text-align: center;
    max-width: 80px;
}

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

.info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-row span {
    font-size: 12px;
    color: var(--ink-soft);
}

.info-row strong {
    font-size: 14px;
    color: var(--board);
}

/* Delivery Section */
.delivery-section p {
    font-family: var(--body);
    font-size: 14px;
    color: var(--board);
    line-height: 1.6;
}

/* Order Items */
.order-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--cream);
    border-radius: var(--radius-sm);
}

.order-item-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.order-item-qty {
    font-family: var(--body);
    font-size: 14px;
    font-weight: 600;
    color: var(--board);
    background: var(--white-ghost);
    padding: 4px 10px;
    border-radius: 6px;
}

.order-item-name {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 500;
    color: var(--board);
}

.order-item-price {
    font-family: var(--body);
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
}

/* ===== FOOTER STYLES REMOVED - USING STYLE.CSS ===== */

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .orders-stats {
        grid-template-columns: 1fr;
    }

    .order-body {
        grid-template-columns: 1fr;
    }

    .order-total-section {
        align-items: flex-start;
    }

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

    .order-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-timeline {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .status-timeline::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .orders-page {
        padding: 24px 16px 40px;
    }

    .filter-tabs {
        overflow-x: auto;
    }

    .tab-btn {
        flex: 0 0 auto;
    }

    .modal-content {
        margin: 0;
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: calc(100vh - 40px);
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }
}

/* Chwa kliyan an te fè — kuizin nan bezwen wè yo pou prepare bon plat la. */
.order-item-options {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #8F3D20;
    margin-top: 2px;
}
