/* ─── TRACKING PAGE ─────────────────────────────────────────────── */
.tracking-body {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.tracking-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.tracking-back {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tracking-back:hover { color: var(--primary); }

.tracking-logo {
    font-size: 1rem;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tracking-logo span { color: var(--secondary); }
.tracking-logo-img { height: 34px; width: auto; display: block; }
.summary-addons { display: block; font-size: 0.76rem; color: #8a93a5; margin-top: 2px; }

/* ─── RESPONSIVE (следење) ─────────────────────────────── */
@media (max-width: 420px) {
    .tracking-header { padding: 12px 14px; }
    .tracking-main { padding: 16px 12px 28px; }
    .status-header { padding: 28px 18px 24px; }
    .stepper { padding: 16px 8px 14px; }
    .stepper-label { font-size: 0.62rem; }
    .status-title { font-size: 1.15rem; }
}

.tracking-main {
    flex: 1;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 16px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ─── STATUS CARD ────────────────────────────────────────────────── */
.status-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: cardIn 0.4s cubic-bezier(0.4,0,0.2,1);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.status-header {
    padding: 36px 24px 32px;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.status-header[data-status="new"]       { background: linear-gradient(135deg, #E63946 0%, #780000 100%); }
.status-header[data-status="preparing"] { background: linear-gradient(135deg, #E65100 0%, #8C3400 100%); }
.status-header[data-status="ready"]     { background: linear-gradient(135deg, #1565C0 0%, #0A3D7A 100%); }
.status-header[data-status="delivered"] { background: linear-gradient(135deg, #2D6A4F 0%, #1B4332 100%); }

.status-header::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
}

.status-icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 14px;
}

.status-big-icon {
    font-size: 5rem;
    display: block;
    line-height: 1;
    animation: iconPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

@keyframes iconPop {
    0%   { transform: scale(0) rotate(-10deg); opacity: 0; }
    70%  { transform: scale(1.15) rotate(3deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.status-pulse-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.4);
    animation: pulseRing 2.5s ease-out infinite;
}

@keyframes pulseRing {
    0%   { transform: scale(0.85); opacity: 0.9; }
    100% { transform: scale(1.5); opacity: 0; }
}

.status-title {
    font-size: 1.7rem;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.status-desc {
    font-size: 0.92rem;
    opacity: 0.88;
    line-height: 1.55;
    max-width: 320px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ─── ETA DISPLAY ───────────────────────────────────────────────── */
.eta-display {
    margin: 14px auto 0;
    background: rgba(255,255,255,0.2);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 14px;
    padding: 10px 22px;
    display: inline-block;
    text-align: center;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(4px);
}

.eta-label {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.85;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.eta-value {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.eta-left {
    font-size: 0.76rem;
    opacity: 0.75;
    margin-top: 3px;
}

/* ─── STEPPER ────────────────────────────────────────────────────── */
.stepper {
    display: flex;
    align-items: flex-start;
    padding: 20px 16px 18px;
    border-bottom: 1px solid var(--gray-100);
    gap: 0;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 54px;
}

.stepper-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2.5px solid var(--gray-200);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.stepper-step.done .stepper-dot {
    border-color: var(--success-light);
    background: var(--success-light);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
}

.stepper-step.current .stepper-dot {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 0 0 5px rgba(230,57,70,0.18);
    animation: currentPulse 2s ease infinite;
}

@keyframes currentPulse {
    0%, 100% { box-shadow: 0 0 0 5px rgba(230,57,70,0.18); }
    50%       { box-shadow: 0 0 0 8px rgba(230,57,70,0.08); }
}

.stepper-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gray-400);
    text-align: center;
    line-height: 1.3;
    max-width: 54px;
    white-space: normal;
}

.stepper-step.done .stepper-label    { color: var(--success); }
.stepper-step.current .stepper-label { color: var(--primary); font-weight: 800; }

.stepper-line {
    flex: 1;
    height: 2.5px;
    background: var(--gray-200);
    margin-bottom: 26px;
    border-radius: 2px;
    min-width: 12px;
    transition: background 0.5s ease;
}

.stepper-line.done { background: var(--success-light); }

/* ─── HISTORY ────────────────────────────────────────────────────── */
.history-section {
    padding: 16px 20px;
}

.history-title {
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--gray-400);
    margin-bottom: 12px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}

.history-item + .history-item::before {
    content: '';
    position: absolute;
    left: 10px;
    top: -8px;
    width: 2px;
    height: 8px;
    background: var(--gray-200);
}

.history-item.h-done + .history-item::before { background: var(--success-light); }

.history-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
    flex-shrink: 0;
    font-weight: 700;
    transition: var(--transition);
}

.history-item.h-done .history-dot {
    background: var(--success-light);
    border-color: var(--success-light);
}

.history-item.h-current .history-dot {
    background: var(--primary);
    border-color: var(--primary);
}

.history-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.history-stage-label {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--gray-400);
}

.history-item.h-done .history-stage-label    { color: var(--secondary); }
.history-item.h-current .history-stage-label  { color: var(--primary); font-weight: 700; }

.history-time {
    font-size: 0.76rem;
    color: var(--gray-400);
    white-space: nowrap;
}

.history-item.h-done .history-time { color: var(--gray-600); }

/* ─── ORDER META ─────────────────────────────────────────────────── */
.order-meta-row {
    padding: 12px 20px;
    background: var(--bg);
    font-size: 0.82rem;
    color: var(--gray-400);
    text-align: center;
    border-top: 1px solid var(--gray-100);
}

.order-meta-row strong { color: var(--secondary); }

/* ─── ORDER SUMMARY CARD ─────────────────────────────────────────── */
.order-summary-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.summary-head {
    padding: 13px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-items { list-style: none; }

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

.summary-emoji { font-size: 1.25rem; }

.summary-name {
    flex: 1;
    font-weight: 600;
    color: var(--secondary);
}

.summary-qty {
    color: var(--gray-400);
    font-size: 0.8rem;
    font-weight: 400;
    margin-left: 4px;
}

.summary-price { font-weight: 700; color: var(--secondary); font-size: 0.88rem; }

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 18px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--secondary);
}

.summary-total-amount {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--primary);
}

.summary-note {
    padding: 10px 18px;
    background: #FFFDE7;
    font-size: 0.83rem;
    color: var(--gray-600);
    font-style: italic;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

/* ─── LIVE INDICATOR ─────────────────────────────────────────────── */
.tracking-footer {
    text-align: center;
    padding: 14px 16px 24px;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 0.78rem;
    color: var(--gray-400);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.live-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-light);
    animation: livePulse 2s ease infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.7; }
}

/* ─── ERROR STATE ────────────────────────────────────────────────── */
.tracking-error {
    text-align: center;
    padding: 60px 24px;
    max-width: 420px;
    margin: 20px auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.error-icon { font-size: 4rem; margin-bottom: 18px; }

.tracking-error h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 10px;
}

.tracking-error p {
    color: var(--gray-600);
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 0.92rem;
}

.btn-back-home {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 13px 28px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-back-home:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ─── STATUS CHANGE ANIMATION ────────────────────────────────────── */
.status-changed {
    animation: statusFlash 0.7s ease;
}

@keyframes statusFlash {
    0%   { opacity: 0.4; transform: scale(0.98); }
    50%  { opacity: 1; }
    100% { opacity: 1; transform: scale(1); }
}

/* ─── DELIVERED CELEBRATION ──────────────────────────────────────── */
.confetti-wrap {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    top: -20px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ─── ОЦЕНА ОД КЛИЕНТ ───────────────────────────────────── */
.rating-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    margin-top: 18px;
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,0.08));
    text-align: center;
}
.rating-head {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark, #1D3557);
    margin-bottom: 14px;
}
.rating-stars {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
}
.rating-star {
    background: none;
    border: none;
    font-size: 2.2rem;
    line-height: 1;
    color: #FFD166;
    cursor: pointer;
    transition: transform .12s;
    padding: 0;
}
.rating-star:hover { transform: scale(1.15); }
.rating-star.active { color: #F4A261; }
.rating-input {
    width: 100%;
    border: 1.5px solid #E0E3EC;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    outline: none;
    margin-bottom: 12px;
}
.rating-input:focus { border-color: var(--primary, #E63946); }
.rating-submit {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 13px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary, #E63946);
    cursor: pointer;
    transition: opacity .15s;
}
.rating-submit:disabled { opacity: .45; cursor: not-allowed; }
.rating-msg { margin: 10px 0 0; font-size: 0.85rem; min-height: 14px; }
.rating-msg.error { color: #DC2626; }
.rating-stars-static { font-size: 2rem; color: #F4A261; letter-spacing: 4px; }
.rating-feedback {
    margin-top: 12px;
    font-style: italic;
    color: #52607A;
    font-size: 0.95rem;
}
.rating-thanks {
    margin-top: 12px;
    font-weight: 600;
    color: var(--secondary, #2D6A4F);
}
