
/* =========================================
   ANEKAM ASTRO - MY ORDERS PAGE
========================================= */

.my-orders-page {
    min-height: 75vh;
    padding: 35px 20px 65px;
    background: #FFFCF5;
}

/* PAGE HEADING */

.orders-hero {
    text-align: center;
    margin: 0 auto 35px;
}

.orders-eyebrow {
    color: #C5A15A;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    margin: 0 0 7px;
}

.orders-hero h1 {
    margin: 0;
    color: #08234C;
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    font-weight: 700;
}

.orders-ornament {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: #C5A15A;
    margin: 8px 0;
}

.orders-ornament span {
    width: 45px;
    height: 1px;
    background: #C5A15A;
}

.orders-hero > p:last-child {
    color: #77716A;
    font-size: 13px;
    margin: 0;
}

/* MAIN LAYOUT */

.orders-layout {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 28px;
    width: min(100%, 1200px);
    margin: 0 auto;
    align-items: start;
}

/* SIDEBAR */

.orders-sidebar {
    background: #FFFFFF;
    border: 1px solid #EADFCB;
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 5px 20px rgba(8, 35, 76, 0.04);
}

.account-navigation {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.account-nav-item {
    width: 100%;
    min-height: 49px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #555B65;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: 0.2s ease;
}

.account-nav-item:hover {
    background: #F8F3E9;
    color: #08234C;
}

.account-nav-item.active {
    color: #FFFFFF;
    background: #08234C;
    font-weight: 600;
}

.account-nav-icon {
    width: 22px;
    text-align: center;
    font-size: 19px;
}

.account-logout-btn {
    border-top: 1px solid #EEE7DC;
    border-radius: 0;
    margin-top: 8px;
    padding-top: 17px;
    color: #B33A32;
}

/* ORDERS CONTENT */

.orders-content {
    min-width: 0;
}

/* FILTERS */

.order-filter-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.order-filter {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border: 1px solid #E7DDCC;
    border-radius: 25px;
    background: #FFFFFF;
    color: #555B65;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease;
}

.order-filter span {
    min-width: 19px;
    height: 19px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #F1EADF;
    color: #08234C;
    font-size: 10px;
}

.order-filter:hover {
    border-color: #C5A15A;
    color: #08234C;
}

.order-filter.active {
    background: #08234C;
    border-color: #08234C;
    color: #FFFFFF;
}

.order-filter.active span {
    background: #C5A15A;
    color: #FFFFFF;
}

/* ORDER LIST */

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

/* ORDER CARD */

.order-card {
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #EADFCB;
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(8, 35, 76, 0.035);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px 20px;
    background: #FBF8F1;
    border-bottom: 1px solid #EEE7DC;
}

.order-card-number {
    color: #08234C;
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.order-card-date {
    margin-top: 4px;
    color: #858078;
    font-size: 11px;
}

.order-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.order-status.placed {
    color: #8A641B;
    background: #FFF2D3;
}

.order-status.processing {
    color: #1755A1;
    background: #E6F0FF;
}

.order-status.shipped {
    color: #6942A1;
    background: #F0E9FF;
}

.order-status.delivered {
    color: #18733B;
    background: #E5F7EA;
}

.order-status.cancelled {
    color: #A52A20;
    background: #FDE9E6;
}

.order-status.default {
    color: #555B65;
    background: #F0F0F0;
}

/* CARD BODY */

.order-card-body {
    padding: 17px 20px;
}

.order-product-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 9px 0;
}

.order-product-image {
    width: 76px;
    height: 76px;
    object-fit: contain;
    background: #FFFFFF;
    border: 1px solid #EEE7DC;
    border-radius: 10px;
}

.order-product-placeholder {
    width: 76px;
    height: 76px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #FBF8F1;
    border: 1px solid #EEE7DC;
    border-radius: 10px;
    color: #C5A15A;
    font-size: 25px;
}

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

.order-product-name {
    color: #08234C;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.order-product-meta {
    margin-top: 5px;
    color: #858078;
    font-size: 11px;
}

.order-product-price {
    color: #08234C;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

/* CARD FOOTER */

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px 20px;
    border-top: 1px solid #EEE7DC;
}

.order-total-label {
    color: #77716A;
    font-size: 11px;
}

.order-total-amount {
    display: block;
    margin-top: 3px;
    color: #08234C;
    font-size: 19px;
    font-weight: 700;
}

.order-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.order-view-btn,
.order-buy-again-btn {
    min-height: 38px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.order-view-btn {
    color: #FFFFFF;
    background: #08234C;
    border: 1px solid #08234C;
}

.order-view-btn:hover {
    background: #061A38;
}

.order-buy-again-btn {
    color: #E96A16;
    background: #FFFFFF;
    border: 1px solid #E96A16;
}

.order-buy-again-btn:hover {
    color: #FFFFFF;
    background: #E96A16;
}

/* LOADING */

.orders-loading {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: #77716A;
    font-size: 13px;
}

.orders-spinner {
    width: 35px;
    height: 35px;
    border: 3px solid #EADFCB;
    border-top-color: #08234C;
    border-radius: 50%;
    animation: ordersSpin 0.8s linear infinite;
}

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

/* ERROR */

.orders-error,
.orders-empty,
.orders-no-results {
    padding: 45px 25px;
    background: #FFFFFF;
    border: 1px solid #EADFCB;
    border-radius: 14px;
    text-align: center;
}

.orders-error-icon {
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #FDE9E6;
    color: #A52A20;
    font-size: 22px;
    font-weight: 700;
}

.orders-error h3,
.orders-empty h2,
.orders-no-results h3 {
    margin: 0 0 8px;
    color: #08234C;
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
}

.orders-error p,
.orders-empty p,
.orders-no-results p {
    max-width: 430px;
    margin: 0 auto 18px;
    color: #77716A;
    font-size: 12px;
    line-height: 1.7;
}

.orders-retry-btn,
.empty-shop-btn {
    min-height: 42px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    border: 0;
    border-radius: 8px;
    background: #08234C;
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.orders-empty-icon {
    margin-bottom: 12px;
    color: #C5A15A;
    font-size: 45px;
}

.orders-no-results {
    margin-top: 10px;
}

/* =========================================
   ORDER DETAILS MODAL
========================================= */

.order-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(5, 19, 39, 0.62);
    backdrop-filter: blur(3px);
}

.order-modal-overlay[hidden] {
    display: none;
}

.order-modal {
    width: min(100%, 700px);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #EADFCB;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.order-modal-header {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 19px 24px;
    background: #FBF8F1;
    border-bottom: 1px solid #EEE7DC;
}

.order-modal-header p {
    margin: 0 0 3px;
    color: #C5A15A;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
}

.order-modal-header h2 {
    margin: 0;
    color: #08234C;
    font-family: 'Cormorant Garamond', serif;
    font-size: 27px;
}

.order-modal-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #EFE7D9;
    color: #08234C;
    font-size: 25px;
    cursor: pointer;
}

.order-modal-body {
    padding: 23px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #C5A15A #F8F4EC;
}

.order-modal-body::-webkit-scrollbar {
    width: 6px;
}

.order-modal-body::-webkit-scrollbar-thumb {
    background: #C5A15A;
    border-radius: 10px;
}

.order-modal-body::-webkit-scrollbar-track {
    background: #F8F4EC;
}

/* MODAL CONTENT */

.modal-section {
    margin-bottom: 22px;
}

.modal-section h3 {
    margin: 0 0 12px;
    color: #08234C;
    font-size: 14px;
}

.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 16px;
    background: #FBF8F1;
    border-radius: 10px;
}

.modal-info-label {
    display: block;
    margin-bottom: 4px;
    color: #858078;
    font-size: 10px;
}

.modal-info-value {
    color: #08234C;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.modal-address {
    padding: 14px;
    border: 1px solid #EEE7DC;
    border-radius: 10px;
    color: #555B65;
    font-size: 12px;
    line-height: 1.8;
}

.modal-product {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #EEE7DC;
}

.modal-product img,
.modal-product-placeholder {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border: 1px solid #EEE7DC;
    border-radius: 8px;
}

.modal-product-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #C5A15A;
}

.modal-product-name {
    color: #08234C;
    font-size: 12px;
    font-weight: 600;
}

.modal-product-meta {
    margin-top: 4px;
    color: #858078;
    font-size: 10px;
}

.modal-product-price {
    color: #08234C;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.modal-total {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #EADFCB;
    color: #08234C;
    font-size: 15px;
    font-weight: 700;
}

/* FOOTER */

.site-footer {
    padding: 22px 15px;
    background: #061A38;
    color: #FFFFFF;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 11px;
    opacity: 0.85;
}

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

@media (max-width: 900px) {

    .orders-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .orders-sidebar {
        padding: 8px;
    }

    .account-navigation {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .account-nav-item {
        width: auto;
        flex: 1;
        justify-content: center;
        padding: 10px;
        font-size: 11px;
    }

    .account-logout-btn {
        border-top: 0;
        margin-top: 0;
        padding-top: 10px;
    }
}

@media (max-width: 600px) {

    .my-orders-page {
        padding: 25px 12px 45px;
    }

    .orders-hero {
        margin-bottom: 23px;
    }

    .orders-hero h1 {
        font-size: 35px;
    }

    .orders-sidebar {
        overflow-x: auto;
    }

    .account-navigation {
        min-width: 470px;
        flex-wrap: nowrap;
    }

    .account-nav-item {
        flex: 1;
        white-space: nowrap;
    }

    .order-filter-bar {
        gap: 7px;
    }

    .order-filter {
        padding: 8px 10px;
        font-size: 10px;
    }

    .order-card-header {
        padding: 13px 14px;
    }

    .order-card-body {
        padding: 12px 14px;
    }

    .order-product-row {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 11px;
    }

    .order-product-image,
    .order-product-placeholder {
        width: 60px;
        height: 60px;
    }

    .order-product-price {
        grid-column: 2;
        font-size: 12px;
    }

    .order-card-footer {
        padding: 13px 14px;
    }

    .order-total-amount {
        font-size: 17px;
    }

    .order-card-actions {
        width: 100%;
    }

    .order-card-actions button,
    .order-card-actions a {
        flex: 1;
    }

    .order-modal-overlay {
        padding: 10px;
    }

    .order-modal-body {
        padding: 15px;
    }

    .modal-info-grid {
        grid-template-columns: 1fr;
    }
}
/* Hide loading indicator when orders have loaded */
#ordersLoading[hidden] {
    display: none !important;
}
.modal-address {
    white-space: pre-line;
    line-height: 1.9;
    padding: 14px 16px;
    color: #4F5665;
    font-size: 13px;
}

/* =========================================
   ORDER TRACKING TIMELINE
========================================= */

.order-tracking-section {
    margin-top: 24px;
}

.order-timeline {
    position: relative;
    padding: 8px 0 4px 8px;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 14px;
    min-height: 67px;
}

.timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 28px;
    height: calc(100% - 20px);
    width: 2px;
    background: #E8E1D5;
}

.timeline-marker {
    position: relative;
    z-index: 1;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #D8D0C3;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
}

.timeline-item.completed .timeline-marker,
.timeline-item.current .timeline-marker {
    background: #08234C;
    border-color: #08234C;
}

.timeline-item.completed:not(:last-child)::before {
    background: #C5A15A;
}

.timeline-item.current .timeline-marker {
    border-color: #C5A15A;
    box-shadow: 0 0 0 3px rgba(197, 161, 90, 0.15);
}

.timeline-content {
    padding: 2px 0 16px;
}

.timeline-content strong {
    display: block;
    color: #08234C;
    font-size: 13px;
}

.timeline-content p {
    margin: 4px 0 0;
    color: #77716A;
    font-size: 12px;
}

.timeline-item:not(.completed):not(.current) .timeline-content strong {
    color: #99938B;
}

.timeline-cancelled,
.timeline-pending {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 10px;
    background: #FFF5F3;
    color: #A52A22;
}

.timeline-cancelled > span {
    font-size: 18px;
    font-weight: 700;
}

.timeline-cancelled p,
.timeline-pending p {
    margin: 5px 0 0;
    font-size: 12px;
}
