/* ===== My Orders (RTL / Mobile First) ===== */

.orders-page {
    min-height: calc(100vh - 200px);
    padding: 0 0 5rem;
    background: radial-gradient(1200px 400px at 90% -10%, rgba(0, 188, 212, 0.12), transparent 60%),
        radial-gradient(900px 380px at 10% 0%, rgba(13, 59, 102, 0.10), transparent 55%),
        #f5f7fa;
}

.orders-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.25rem 0 0.75rem;
}

.orders-title {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark-color);
    font-size: 1.85rem;
    font-weight: 900;
}

.orders-title i {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(0, 188, 212, 0.12);
    color: var(--navy-color);
}

.orders-subtitle {
    margin-top: 0.3rem;
    color: rgba(15, 23, 42, 0.65);
    font-weight: 500;
}

.btn-refresh {
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.10);
    color: var(--dark-color);
    padding: 0.7rem 1rem;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-refresh:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.btn-refresh:active {
    transform: translateY(1px);
}

/* ===== Sticky Tabs ===== */

.orders-tabs {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(245, 247, 250, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.75rem 0 0.5rem;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    gap: 0.5rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.orders-tabs::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(0, 188, 212, 0.0), rgba(0, 188, 212, 0.35), rgba(0, 188, 212, 0.0));
    pointer-events: none;
}

.orders-tabs::-webkit-scrollbar {
    height: 6px;
}

.orders-tabs::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.14);
    border-radius: 999px;
}

.tab {
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.75);
    color: var(--dark-color);
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tab:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.tab.is-active {
    background: rgba(0, 188, 212, 0.14);
    border-color: rgba(0, 188, 212, 0.35);
    color: var(--navy-color);
    box-shadow: var(--shadow);
}

.tab.is-active {
    background: linear-gradient(180deg, rgba(0, 188, 212, 0.22), rgba(0, 188, 212, 0.10));
}

.orders-content {
    margin-top: 1rem;
}

/* ===== Order Cards ===== */

.orders-grid {
    display: grid;
    gap: 1rem;
}

.order-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    overflow: hidden;
}

.order-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 188, 212, 0.28);
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 4px;
    background: rgba(15, 23, 42, 0.10);
}

.order-card.order-status-processing::before { background: rgba(245, 158, 11, 0.65); }
.order-card.order-status-paid::before { background: rgba(99, 102, 241, 0.65); }
.order-card.order-status-delivered::before { background: rgba(34, 197, 94, 0.65); }
.order-card.order-status-cancelled::before { background: rgba(239, 68, 68, 0.65); }

.order-card.order-status-processing {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), #fff 55%);
}

.order-card.order-status-paid {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.07), #fff 55%);
}

.order-card.order-status-delivered {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.07), #fff 55%);
}

.order-card.order-status-cancelled {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.06), #fff 55%);
}

.order-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.85rem;
}

.order-id {
    font-weight: 900;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.05rem;
}

.order-date {
    margin-top: 0.25rem;
    color: rgba(15, 23, 42, 0.65);
    font-weight: 500;
    font-size: 0.92rem;
}

.order-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-weight: 900;
    font-size: 0.9rem;
    white-space: nowrap;
}

.order-status i {
    font-size: 1rem;
}

.status-processing { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.status-paid { background: rgba(99, 102, 241, 0.14); color: #3730a3; }
.status-delivered { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.status-cancelled { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }

.order-total {
    margin-top: 0.35rem;
    font-weight: 900;
    color: var(--navy-color);
}

.order-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.btn {
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(15, 23, 42, 0.05);
    color: var(--dark-color);
    padding: 0.6rem 0.95rem;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    border-color: rgba(0, 188, 212, 0.30);
    background: rgba(0, 188, 212, 0.14);
    color: var(--navy-color);
}

.btn-danger {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.btn-muted {
    border-color: rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.03);
    color: rgba(15, 23, 42, 0.70);
    cursor: default;
}

.btn-muted:hover {
    box-shadow: none;
    transform: none;
}

/* ===== Empty State ===== */

.orders-empty {
    background: #fff;
    border: 1px dashed rgba(15, 23, 42, 0.18);
    border-radius: 18px;
    padding: 2rem 1rem;
    text-align: center;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.75rem;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(0, 188, 212, 0.12);
    color: var(--navy-color);
    font-size: 1.5rem;
}

.orders-empty h3 {
    font-weight: 900;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

.empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--navy-color);
    color: #fff;
    text-decoration: none;
    padding: 0.8rem 1.1rem;
    border-radius: 14px;
    font-weight: 900;
}

/* ===== Bottom Sheet ===== */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 3800;
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3900;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -24px 50px rgba(15, 23, 42, 0.18);
    transform: translateY(110%);
    transition: transform 0.25s ease;
    max-height: min(86vh, 720px);
    display: grid;
    grid-template-rows: auto 1fr;
}

.sheet.is-open {
    transform: translateY(0);
}

.sheet-handle {
    width: 56px;
    height: 5px;
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
    margin: 10px auto 0;
}

.sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.12), rgba(13, 59, 102, 0.06));
}

.sheet-order {
    font-weight: 900;
    color: var(--dark-color);
    font-size: 1.15rem;
}

.sheet-meta {
    margin-top: 0.25rem;
    color: rgba(15, 23, 42, 0.65);
    font-weight: 500;
}

/* Unavailable items in sheet */
.sheet-item--unavailable {
    opacity: 0.7;
    background: #fef2f2;
    border-radius: 14px;
    border: 1px solid #fecaca;
}

.sheet-item--unavailable .sheet-item-name {
    text-decoration: line-through;
    color: #b91c1c;
}

.sheet-item--unavailable .sheet-item-meta .sheet-chip {
    text-decoration: line-through;
}

.sheet-item-unavailable-tag {
    color: #b91c1c;
    font-weight: 800;
}

.sheet-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(15, 23, 42, 0.05);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.sheet-body {
    overflow: auto;
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.sheet-section {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.70);
    padding: 0.85rem;
}

.sheet-section-title {
    font-weight: 900;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

.sheet-items {
    display: grid;
    gap: 0.6rem;
}

.sheet-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.sheet-item img {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(15, 23, 42, 0.04);
}

.sheet-item-body {
    min-width: 0;
}

.sheet-item-name {
    font-weight: 900;
    color: var(--dark-color);
    line-height: 1.25;
}

.sheet-item-sub {
    margin-top: 0.2rem;
    color: rgba(15, 23, 42, 0.65);
    font-weight: 600;
}

/* Item Options (Color and Size) in Sheet */
.sheet-item-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #ddd;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.color-name {
    font-size: 0.8rem;
    color: #666;
}

.size-option {
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.sheet-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.sheet-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(0, 188, 212, 0.10);
    color: rgba(15, 23, 42, 0.78);
    font-weight: 800;
    font-size: 0.85rem;
}

.sheet-chip i {
    color: rgba(15, 23, 42, 0.65);
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--dark-color);
    font-weight: 700;
}

.sheet-note {
    border: 1px solid rgba(0, 188, 212, 0.28);
    background: rgba(0, 188, 212, 0.10);
    color: var(--navy-color);
    border-radius: 16px;
    padding: 0.85rem;
    font-weight: 800;
    line-height: 1.4;
}

.sheet-actions {
    display: grid;
    gap: 0.6rem;
}

.sheet-actions .btn {
    width: 100%;
    justify-content: center;
}

@media (max-width: 768px) {
    .orders-page {
        padding: 1rem 0 5.5rem;
    }

    .orders-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (min-width: 768px) {
    .orders-tabs {
        top: 70px;
    }

    .sheet {
        left: 50%;
        right: auto;
        width: min(520px, calc(100% - 40px));
        transform: translate(-50%, 110%);
        border-radius: 18px;
        bottom: 20px;
    }

    .sheet.is-open {
        transform: translate(-50%, 0);
    }
}
