/* ============================================================
   ORDERS PAGE — orders.css  (Shopee Food style)
   Dùng biến màu từ style.css
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────── */
.orders-hero {
    background: linear-gradient(rgba(0,0,0,0.42), rgba(0,0,0,0.42)),
                url('https://i.pinimg.com/1200x/ba/d7/28/bad728e082d7959a59a79f7b8d773e3a.jpg') center/cover no-repeat;
    padding: 2.5rem 0 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* ── Hero shipper illustration ─────────────────────────── */
.hero-shipper {
    position: absolute;
    right: 3%;
    bottom: 0;
    height: 105%;
    max-height: 185px;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    opacity: 0.92;
}
.hero-shipper svg {
    height: 100%;
    width: auto;
    display: block;
}
/* Keep text above the illustration */
.orders-hero .container { position: relative; z-index: 1; }

/* Wheel spin animations */
@keyframes hs-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.hs-spokes-r { transform-origin: 78px 138px;  animation: hs-spin 1.1s linear infinite; }
.hs-spokes-f { transform-origin: 228px 138px; animation: hs-spin 1.1s linear infinite; }

@media (max-width: 575.98px) { .hero-shipper { display: none; } }

.orders-hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.orders-hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.orders-hero-sub {
    color: rgba(255,255,255,0.78);
    margin-bottom: 0;
    font-size: 0.88rem;
}

.eyebrow {
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    opacity: 0.82;
    color: #fff;
}

.orders-hero-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ── Poll indicator ──────────────────────────────────── */
.poll-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 2rem;
    padding: 0.32rem 0.85rem;
    backdrop-filter: blur(6px);
}

.poll-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
    animation: poll-blink 1.4s ease-in-out infinite;
}

@keyframes poll-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 5rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce-slow 2s ease-in-out infinite;
}

@keyframes bounce-slow {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-12px); }
}

.empty-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sf-text, #212121);
    margin-bottom: 0.5rem;
}

.empty-sub {
    color: var(--sf-muted, #9E9E9E);
    max-width: 380px;
    margin: 0 auto 1.5rem;
    font-size: 0.88rem;
}

/* ── Orders grid ─────────────────────────────────────── */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

/* ── Order card ──────────────────────────────────────── */
.order-card {
    background: #fff;
    border: 1px solid var(--sf-border, #EEEEEE);
    border-radius: 14px;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    animation: card-in 0.35s ease both;
}

.order-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(238,77,45,0.12);
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.order-card:nth-child(1) { animation-delay: 0s; }
.order-card:nth-child(2) { animation-delay: 0.07s; }
.order-card:nth-child(3) { animation-delay: 0.14s; }
.order-card:nth-child(4) { animation-delay: 0.21s; }
.order-card:nth-child(n+5) { animation-delay: 0.28s; }

/* ── Card header ─────────────────────────────────────── */
.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.order-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.order-id {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--sf-text, #212121);
}

.order-time {
    font-size: 0.72rem;
    color: var(--sf-muted, #9E9E9E);
}

/* ── Status badge ────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.73rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pending {
    background: #FFF8EC;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.status-shipping {
    background: #FFF4F2;
    color: #EE4D2D;
    border: 1px solid rgba(238,77,45,0.25);
}

.status-completed {
    background: #ECFDF5;
    color: #065f46;
    border: 1px solid #A7F3D0;
}

.status-cancelled {
    background: #F5F5F5;
    color: #757575;
    border: 1px solid #E0E0E0;
}

/* ── Timeline ────────────────────────────────────────── */
.order-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #F9F9F9;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid var(--sf-border, #EEEEEE);
}

.tl-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.22rem;
    flex-shrink: 0;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.tl-step.done,
.tl-step.active {
    opacity: 1;
}

.tl-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: background 0.3s;
}

.tl-step.done  .tl-icon { background: #D1FAE5; }
.tl-step.active .tl-icon {
    background: #FFF4F2;
    box-shadow: 0 0 0 4px rgba(238,77,45,0.15);
    animation: pulse-ring-orange 1.8s ease-in-out infinite;
}

@keyframes pulse-ring-orange {
    0%   { box-shadow: 0 0 0 0   rgba(238,77,45,0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(238,77,45,0);   }
    100% { box-shadow: 0 0 0 0   rgba(238,77,45,0);   }
}

.tl-label {
    font-size: 0.63rem;
    font-weight: 600;
    color: var(--sf-muted, #9E9E9E);
    text-align: center;
    white-space: nowrap;
}

.tl-step.active .tl-label { color: #EE4D2D; }
.tl-step.done   .tl-label { color: #065f46; }

.tl-line {
    flex: 1;
    height: 2px;
    background: #E5E7EB;
    margin: 0 0.2rem;
    margin-bottom: 1rem;
    border-radius: 2px;
    transition: background 0.4s;
}
.tl-line.done { background: #6EE7B7; }

/* ── Details rows ────────────────────────────────────── */
.order-details {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    border-top: 1px solid var(--sf-border, #EEEEEE);
    padding-top: 0.85rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    font-size: 0.82rem;
}

.detail-label {
    color: var(--sf-muted, #9E9E9E);
    flex-shrink: 0;
}

.detail-value {
    color: var(--sf-text, #212121);
    text-align: right;
    word-break: break-word;
}

.detail-value.price {
    font-weight: 700;
    color: #EE4D2D;
}

/* ── Cancelled card ──────────────────────────────────── */
.card-cancelled {
    opacity: 0.72;
    border-color: #E0E0E0;
}

.card-cancelled .order-timeline.cancelled-timeline {
    justify-content: center;
    background: #F5F5F5;
    border-color: #E0E0E0;
}

.tl-step.cancelled .tl-icon {
    background: #F5F5F5;
    border: 1px solid #E0E0E0;
}

.tl-step.cancelled .tl-label {
    color: #757575;
}

.tl-step.cancelled {
    opacity: 1;
}

/* ── Cancel button ───────────────────────────────────── */
.order-card-actions {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--sf-border, #EEEEEE);
    display: flex;
    justify-content: flex-end;
}

.btn-cancel-order {
    background: #fff;
    color: #EE4D2D;
    border: 1.5px solid #EE4D2D;
    border-radius: 8px;
    padding: 0.38rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}

.btn-cancel-order:hover:not(:disabled) {
    background: #EE4D2D;
    color: #fff;
}

.btn-cancel-order:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 575.98px) {
    .orders-grid    { grid-template-columns: 1fr; }
    .orders-hero-title { font-size: 1.5rem; }
    .order-timeline { padding: 0.5rem 0.45rem; }
    .tl-label  { font-size: 0.58rem; }
    .tl-icon   { width: 1.8rem; height: 1.8rem; font-size: 0.82rem; }
}
