/* /orders/orders.css
   Order-card styles for orders.html. cart.css (already linked on this
   page) brings in navbar.css/footer.css/cookie-banner.css — this file
   only covers what's specific to the orders list itself. */

.orders-page{
    max-width: 900px;
    margin: 60px auto 0;
    padding: 40px 20px 80px;
    min-height: 60vh;
}

.orders-page h1{
    font-family: var(--headers);
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--main-text);
}

.orders-count{
    color: var(--muted-text);
    margin-bottom: 24px;
    font-size: 14px;
}

.orders-filters{
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.orders-filters::-webkit-scrollbar{ display: none; }

.orders-filter{
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 15px;
    font-size: 13px;
    font-family: var(--body-font);
    color: var(--muted-text);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}
.orders-filter:hover{ border-color: var(--second-color); }
.orders-filter.is-active{
    background: var(--second-color);
    border-color: var(--second-color);
    color: #fff;
    font-weight: 600;
}

.orders-list{
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-card{
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.order-card-header{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.order-vendor{
    font-family: var(--headers);
    font-size: 15px;
    font-weight: 700;
    color: var(--main-text);
    margin: 0 0 4px;
}

.order-date{
    font-size: 12px;
    color: var(--muted-text);
}

.order-status{
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 999px;
    color: #fff;
    white-space: nowrap;
}
.order-status.pending{ background: var(--second-color); }
.order-status.confirmed{ background: var(--blue); }
.order-status.shipped{ background: #2D5FFF; }
.order-status.delivered{ background: var(--muted-text); }
.order-status.cancelled{ background: #999; }

.order-items{
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.order-item-row{
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--main-text);
}
.order-item-row .item-name{
    flex: 1;
}
.order-item-row .item-qty{
    color: var(--muted-text);
    font-size: 13px;
}
.order-item-row .item-price{
    font-weight: 600;
    white-space: nowrap;
}

.order-card-footer{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.order-total{
    font-family: var(--headers);
    font-size: 16px;
    font-weight: 700;
    color: var(--main-text);
}
.order-total span{
    color: var(--second-color);
}

.order-payment-status{
    font-size: 12px;
    color: var(--muted-text);
    text-transform: capitalize;
}

/* Cancel-order section — only ever shown on a pending order (see
   orders-page.js's cancelSectionMarkup). Same expanding-panel pattern as
   .order-return below, styled as a distinct (destructive-leaning) action
   rather than reusing .request-return-btn's neutral look. */
.order-cancel{
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.cancel-order-btn{
    background: none;
    border: 1px solid #d9534f;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #d9534f;
    cursor: pointer;
    transition: background-color 0.18s ease;
}
.cancel-order-btn:hover{ background: rgba(217, 83, 79, 0.08); }

.cancel-confirm-text{
    font-size: 13px;
    color: var(--main-text);
    margin: 0 0 10px;
}
.cancel-confirm-error{
    color: #d9534f;
    font-size: 12px;
    margin: 0 0 8px;
}
.cancel-confirm-actions{
    display: flex;
    gap: 8px;
}
.cancel-confirm-btn{
    background: #d9534f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.cancel-confirm-btn:hover{ background: #c9302c; }
.cancel-confirm-btn:disabled{ opacity: 0.6; cursor: not-allowed; }
.cancel-keep-btn{
    background: none;
    border: none;
    color: var(--muted-text);
    font-size: 13px;
    cursor: pointer;
}
.cancel-keep-btn:disabled{ opacity: 0.6; cursor: not-allowed; }

/* Return/refund section — only ever shown on a delivered order (see
   orders-page.js's returnSectionMarkup). */
.order-return{
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.request-return-btn{
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--second-color);
    cursor: pointer;
    transition: border-color 0.18s ease;
}
.request-return-btn:hover{ border-color: var(--second-color); }

.return-form{
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.return-form textarea{
    resize: vertical;
    min-height: 70px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--body-font);
    font-size: 13px;
    color: var(--main-text);
}
.return-form-error{
    color: #d9534f;
    font-size: 12px;
    margin: 0;
}
.return-form-actions{
    display: flex;
    gap: 8px;
}
.return-submit-btn{
    background: var(--second-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.return-submit-btn:hover{ background: var(--button-hovers); }
.return-submit-btn:disabled{ opacity: 0.6; cursor: not-allowed; }
.return-cancel-btn{
    background: none;
    border: none;
    color: var(--muted-text);
    font-size: 13px;
    cursor: pointer;
}

.return-badge{
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 11px;
    border-radius: 999px;
    color: #fff;
    margin-bottom: 8px;
}
.return-badge--pending{ background: var(--second-color); }
.return-badge--approved{ background: var(--blue); }
.return-badge--rejected{ background: #999; }
.return-badge--refunded{ background: #2e9e5b; }

.return-reason,
.return-decision-note,
.return-hint,
.return-window-note{
    font-size: 13px;
    color: var(--muted-text);
    margin: 4px 0 0;
}
.return-decision-note{
    color: var(--main-text);
    font-style: italic;
}
.return-window-note{
    color: #b5651d;
}
.return-hint a{
    color: var(--second-color);
    font-weight: 600;
}

/* Skeleton loading state */
.skeleton{
    background: linear-gradient(90deg, var(--surface) 25%, var(--border) 37%, var(--surface) 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
    border-radius: 8px;
}
@keyframes skeleton-shimmer{
    0%{ background-position: 100% 50%; }
    100%{ background-position: 0 50%; }
}
.skeleton-order-card{
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}
.skeleton-order-header{ height: 20px; width: 40%; margin-bottom: 16px; }
.skeleton-order-line{ height: 14px; margin-bottom: 10px; }

/* Empty state — matches wishlist.html's pattern */
.empty-orders{
    text-align: center;
    padding: 80px 20px;
    color: var(--muted-text);
}
.empty-orders .empty-icon{
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}
.empty-orders h2{
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--main-text);
}
.empty-orders p{
    margin-bottom: 20px;
}
.empty-orders .browse-link{
    display: inline-block;
    padding: 10px 24px;
    background: var(--second-color);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition);
}
.empty-orders .browse-link:hover{
    background: var(--button-hovers);
}

@media (max-width: 900px){
    .orders-page{
        padding: 28px 20px 60px;
    }
    .orders-page h1{
        font-size: 24px;
    }
}
