/* ================================================================
    SPOON REDESIGN - ORDERS PAGE STYLESHEET
    Version: 1.2 (Fluid Typography Update)
   ================================================================ */

/* ====================
   1. IMPORT DESIGN SYSTEM & SHARED COMPONENTS
   ==================== */
@import url('cart.css');
/* Imports base theme and shared modal/header styles */


/* ====================
   2. ORDERS LIST CONTAINER
   ==================== */

/**
 * SPONSORED AD PLACEHOLDER
 * Native ad card with subtle, calm design
 * Clearly labeled and visually integrated
 */
.ad-section {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.ad-card {
    background: var(--background-light);
    border-radius: var(--radius-medium);
    padding: var(--spacing-md);
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
}

.ad-card__label {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    font-size: 10px;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-card__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-card__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    color: #bbb;
}

.ad-card__placeholder i {
    font-size: 28px;
}

.ad-card__placeholder span {
    font-size: 12px;
    font-weight: 500;
}

.orders-list-container {
    display: grid;
    gap: var(--spacing-sm);
}

/* ====================
   3. ORDER CARD COMPONENT
   ==================== */
/**
 * ORDER CARD
 * Modern, compact card with clear visual hierarchy
 * Primary focus: Order ID, Status, Price
 */
.order-card {
    background: var(--background-white);
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px var(--spacing-md);
    transition: border-color 0.2s ease;
}

.order-card:hover {
    border-color: #d0d0d0;
}

/* --- 3a. Card Header --- */
.order-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
}

.order-card__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.order-card__id {
    font-size: clamp(15px, 2.5vw, 16px);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* --- 3b. Status Badge --- */
.order-card__status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    text-transform: capitalize;
    white-space: nowrap;
}

.status--preparing {
    background-color: #fef5e7;
    color: var(--warning-orange);
}

.status--ready {
    background-color: #e8f5e9;
    color: var(--success-green);
}

.status--completed {
    background-color: #f2f2f2;
    color: #999;
}

/* --- 3c. View Details Button (in header) --- */
.btn--view-details {
    background-color: var(--background-white);
    color: var(--text-primary);
    border: 1px solid #e0e0e0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.btn--view-details:hover {
    background-color: var(--background-light);
    border-color: #d0d0d0;
}

.btn--view-details:active {
    transform: scale(0.96);
    background-color: #e8e8e8;
}

/* --- 3d. Card Body --- */
.order-card__body {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0 0;
    border-top: 1px solid #f0f0f0;
}

.order-card__detail-group .label {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 4px;
    display: block;
    font-weight: 400;
}

.order-card__detail-group .value {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

/* Price value - primary focus */
.order-card__detail-group.align-right .value {
    font-size: clamp(16px, 2.8vw, 18px);
    font-weight: 700;
    color: var(--text-primary);
}

.order-card__detail-group.align-right {
    text-align: right;
}

/* --- 3e. Pre-order Info Bar --- */
.order-card__preorder-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    background-color: #fafafa;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

.order-card__preorder-info i {
    color: var(--brand-primary);
    opacity: 0.6;
    font-size: 12px;
}


/* ====================
   4. EMPTY STATE VIEW
   ==================== */
.empty-orders-view {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-secondary);
}

.empty-orders-view__icon {
    font-size: 64px;
    color: var(--inactive-grey);
}

.empty-orders-view__title {
    /* ✅ FLUID TYPO: Make empty state title responsive */
    font-size: clamp(20px, 4vw, 22px);
    font-weight: 600;
    color: var(--text-primary);
}

.empty-orders-view__cta {
    background: var(--brand-primary);
    color: var(--text-on-brand);
    border: none;
    border-radius: var(--radius-pill);
    padding: 12px var(--spacing-lg);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    margin-top: var(--spacing-md);
}

/* ====================
   5. TOAST NOTIFICATION
   ==================== */
.toast-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translate(-50%, 20px);
    max-width: 450px;
    width: calc(100% - 32px);
    background-color: var(--text-primary);
    color: var(--text-on-brand);
    padding: var(--spacing-md);
    border-radius: var(--radius-medium);
    text-align: center;
    font-weight: 500;
    z-index: 1002;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}


/* ====================
   6. HEADER CLEAR HISTORY BUTTON
   ==================== */
.cart-header__clear-btn {
    position: absolute;
    right: var(--spacing-md);
    background: none;
    border: none;
    color: var(--brand-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    font-family: var(--font-family-main);
}

.cart-header__clear-btn:hover {
    opacity: 0.7;
}

.cart-header__clear-btn.active {
    text-decoration: underline;
}


/* ====================
   7. SELECTION MODE — ORDER CARD CHECKBOX
   ==================== */
.order-card {
    position: relative;
    transition: border-color 0.2s ease, padding-left 0.3s ease;
}

.order-card__checkbox {
    display: none;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    accent-color: var(--brand-primary);
    cursor: pointer;
    z-index: 2;
}

/* When in select mode */
.orders-list-container.select-mode .order-card {
    padding-left: 48px;
    cursor: pointer;
}

.orders-list-container.select-mode .order-card__checkbox {
    display: block;
}

.orders-list-container.select-mode .order-card.selected {
    border-color: var(--brand-primary);
    background: rgba(235, 23, 0, 0.02);
}

/* Non-deletable cards in select mode — greyed out */
.orders-list-container.select-mode .order-card.non-deletable {
    opacity: 0.45;
    pointer-events: none;
}


/* ====================
   8. DELETE ACTION BAR (Sticky Bottom)
   ==================== */
.delete-action-bar {
    position: fixed;
    bottom: 68px;
    left: 0;
    right: 0;
    background: var(--background-white);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 999;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    max-width: 480px;
    margin: 0 auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.delete-action-bar.hidden {
    display: none;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.select-all-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

.btn--delete-confirm {
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn--delete-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn--delete-confirm:not(:disabled):hover {
    background: #c71400;
}

.btn--delete-confirm:not(:disabled):active {
    transform: scale(0.96);
}
