/* ═══════════════════════════════════════════════════
   VIP Order Tracker — vot.css  v2.0
   Clean, single source of truth.
   Mobile-first, desktop enhanced. Zero !important.
═══════════════════════════════════════════════════ */

/* ─────────────────── RESET ─────────────────── */
#vot-wrap, #vot-wrap * { box-sizing: border-box; }

/* ─────────────────── OPEN BUTTON ─────────────────── */
#vot-btn-wrap { text-align: center; padding: 24px 0; }

#vot-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    background: #4D148C;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 15px 38px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 6px 22px rgba(77,20,140,0.38);
    transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
    line-height: 1;
}
#vot-open-btn:hover {
    background: #3b0e6e;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(77,20,140,0.46);
}
#vot-open-btn:active { transform: translateY(0); }
#vot-open-btn svg { flex-shrink: 0; }

/* ─────────────────── OVERLAY ─────────────────── */
#vot-overlay {
    position: fixed;
    inset: 0;
    z-index: 999997;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: vot-fade-in 0.2s ease forwards;
}
#vot-overlay[hidden] { display: none !important; }
@keyframes vot-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ─────────────────── X CLOSE BUTTON ─────────────────── */
#vot-close {
    position: fixed;
    z-index: 999999;
    /* JS sets top/left at runtime */
    top: -300px; left: -300px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #FF6200;
    border: 3px solid #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.55), 0 0 0 3px rgba(255,98,0,0.25);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}
#vot-close:hover  { background: #d95000; transform: scale(1.1); box-shadow: 0 6px 26px rgba(0,0,0,0.6); }
#vot-close:active { transform: scale(0.93); }
#vot-close svg    { pointer-events: none; display: block; }

/* ─────────────────── MODAL ─────────────────── */
#vot-modal {
    position: fixed;
    z-index: 999998;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 28px 80px rgba(0,0,0,0.42);
    /* JS positions this too for desktop */
}
#vot-modal::-webkit-scrollbar       { width: 4px; }
#vot-modal::-webkit-scrollbar-thumb { background: #4D148C; border-radius: 4px; }
#vot-modal::-webkit-scrollbar-track { background: transparent; }

/* ═══ MOBILE (< 640px) — bottom sheet ═══ */
@media (max-width: 639px) {
    #vot-modal {
        left: 0; right: 0;
        bottom: 0;
        top: 108px;
        width: 100%;
        border-radius: 24px 24px 0 0;
        animation: vot-slide-up 0.32s cubic-bezier(0.34, 1.1, 0.64, 1) forwards;
    }
    @keyframes vot-slide-up {
        from { transform: translateY(100%); opacity: 0.6; }
        to   { transform: translateY(0);    opacity: 1; }
    }
    /* X button in the dark gap */
    #vot-close {
        top: 52px !important;
        right: 14px !important;
        left: auto !important;
    }
}

/* ═══ DESKTOP (≥ 640px) — centered dialog ═══ */
@media (min-width: 640px) {
    #vot-modal {
        top: 50%;
        left: 50%;
        width: 580px;
        max-height: 86vh;
        border-radius: 20px;
        transform: translate(-50%, -50%);
        animation: vot-pop-in 0.3s cubic-bezier(0.34, 1.12, 0.64, 1) forwards;
    }
    @keyframes vot-pop-in {
        from { transform: translate(-50%, calc(-50% + 18px)) scale(0.97); opacity: 0; }
        to   { transform: translate(-50%, -50%)               scale(1);    opacity: 1; }
    }
}

/* ═══════════════════════════════
   SEARCH SCREEN
═══════════════════════════════ */
#vot-search { padding: 44px 40px 40px; }

#vot-search-header { text-align: center; margin-bottom: 30px; }

/* FedEx logo — transparent PNG, no wrapper needed */
.vot-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
    height: 56px;
}
.vot-logo-wrap img {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
    background: transparent;
}

#vot-search-header h2 {
    font-size: 23px;
    font-weight: 800;
    color: #111;
    margin: 14px 0 7px;
    letter-spacing: -0.4px;
    line-height: 1.2;
}
#vot-search-header p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* Input row */
#vot-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
}
#vot-input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 2px solid #e2e2e2;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #111;
    background: #f9f9f9;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    -webkit-appearance: none;
}
#vot-input:focus {
    border-color: #4D148C;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(77,20,140,0.09);
}
#vot-input::placeholder { color: #c0c0c0; }

#vot-track-btn {
    flex-shrink: 0;
    padding: 14px 26px;
    background: #FF6200;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
#vot-track-btn:hover  { background: #d95000; transform: translateY(-1px); }
#vot-track-btn:active { transform: translateY(0); }

/* Error message */
#vot-error {
    display: none;
    margin-top: 11px;
    padding: 11px 14px;
    background: #fff5f5;
    border: 1px solid #f8c0c0;
    border-radius: 9px;
    color: #c0392b;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    line-height: 1.4;
}
#vot-error:not([hidden]) { display: block; }

/* ═══════════════════════════════
   RESULT SCREEN
═══════════════════════════════ */
#vot-result { padding-bottom: 40px; }

/* ── Header bar ── */
#vot-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid #eee;
    border-radius: 20px 20px 0 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

#vot-back {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    border: 1.5px solid #e8e8e8;
    color: #333;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.14s, border-color 0.14s;
    -webkit-tap-highlight-color: transparent;
}
#vot-back:hover { background: #ebebeb; border-color: #ddd; }

.vot-header-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}
.vot-header-logo img {
    height: 28px;
    width: auto;
    object-fit: contain;
    display: block;
    background: transparent;
}

.vot-header-pill {
    flex-shrink: 0;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 13px;
    border-radius: 20px;
    background: #4D148C;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.3px;
    line-height: 1.4;
}
.vot-header-pill.delivered    { background: #1a7a3e; }
.vot-header-pill.out-delivery { background: #FF6200; }
.vot-header-pill.in-transit   { background: #1565c0; }
.vot-header-pill.delayed      { background: #c0392b; }

/* ── Summary rows ── */
#vot-summary {
    margin: 16px 18px 0;
    border: 1px solid #efefef;
    border-radius: 14px;
    overflow: hidden;
    background: #fafafa;
}

.vot-summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid #f2f2f2;
    background: #fff;
    transition: background 0.1s;
}
.vot-summary-row:last-child { border-bottom: none; }
.vot-summary-row:hover { background: #fafcff; }

.vot-row-label {
    flex-shrink: 0;
    width: 105px;
    font-size: 10px;
    font-weight: 700;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    padding-top: 3px;
    line-height: 1.2;
}
.vot-row-val {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #111;
    text-align: right;
    line-height: 1.45;
    word-break: break-word;
}

/* Status pill in summary */
.vot-status-pill {
    display: inline-block;
    padding: 4px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #4D148C;
    line-height: 1.4;
}
.vot-status-pill.delivered    { background: #1a7a3e; }
.vot-status-pill.out-delivery { background: #FF6200; }
.vot-status-pill.in-transit   { background: #1565c0; }
.vot-status-pill.delayed      { background: #c0392b; }

/* ── Timeline ── */
#vot-timeline {
    margin: 22px 18px 0;
    padding-bottom: 4px;
}

.vot-tl-title {
    font-size: 10px;
    font-weight: 700;
    color: #c0c0c0;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    margin: 0 0 18px;
    line-height: 1;
}

.vot-step {
    display: flex;
    gap: 14px;
    position: relative;
    padding-bottom: 26px;
}
.vot-step:last-child { padding-bottom: 0; }

/* Vertical connector line */
.vot-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 25px;
    bottom: 0;
    width: 2px;
    background: #eee;
    border-radius: 1px;
}
.vot-step.done:not(:last-child)::before {
    background: linear-gradient(to bottom, #4D148C, #7b22e0);
}

/* Step dot */
.vot-dot {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2.5px solid #ddd;
    background: #fff;
    margin-top: 1px;
    position: relative;
    z-index: 1;
    transition: background 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.vot-step.done    .vot-dot {
    background: #4D148C;
    border-color: #4D148C;
}
.vot-step.current .vot-dot {
    background: #FF6200;
    border-color: #FF6200;
    box-shadow: 0 0 0 5px rgba(255,98,0,0.16);
    animation: vot-pulse 2.2s ease infinite;
}
@keyframes vot-pulse {
    0%,100% { box-shadow: 0 0 0 4px rgba(255,98,0,0.16); }
    50%      { box-shadow: 0 0 0 9px rgba(255,98,0,0.05); }
}

/* Checkmark in done dot */
.vot-step.done .vot-dot::after {
    content: '';
    position: absolute;
    top: 4px; left: 3px;
    width: 9px; height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
}

/* Step text */
.vot-step-body  { flex: 1; min-width: 0; padding-top: 1px; }
.vot-step-label {
    font-size: 14px;
    font-weight: 700;
    color: #d0d0d0;
    margin-bottom: 4px;
    line-height: 1.3;
    transition: color 0.2s;
}
.vot-step.done    .vot-step-label { color: #111; }
.vot-step.current .vot-step-label { color: #FF6200; }

.vot-step-sub {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}
.vot-step-sub.muted { color: #bbb; }

/* ═══ MOBILE TWEAKS ═══ */
@media (max-width: 639px) {
    #vot-search { padding: 30px 18px 26px; }
    .vot-logo-wrap { height: 42px; }
    #vot-search-header h2 { font-size: 20px; }
    #vot-input-row { flex-direction: column; gap: 10px; }
    #vot-input { font-size: 16px; } /* prevent iOS zoom */
    #vot-track-btn { padding: 14px; font-size: 16px; width: 100%; text-align: center; }
    #vot-result-header { border-radius: 24px 24px 0 0; padding: 12px 14px; }
    .vot-header-logo img { height: 24px; }
    #vot-summary { margin: 14px 14px 0; border-radius: 12px; }
    .vot-summary-row { padding: 11px 14px; }
    .vot-row-label { width: 88px; font-size: 9px; }
    .vot-row-val   { font-size: 13px; }
    #vot-timeline  { margin: 18px 14px 0; }
    .vot-step-label { font-size: 13px; }
}

/* ═══ DESKTOP TWEAKS ═══ */
@media (min-width: 640px) {
    #vot-search { padding: 46px 44px 42px; }
    .vot-logo-wrap { height: 60px; }
    #vot-search-header h2 { font-size: 24px; }
    #vot-result-header { border-radius: 20px 20px 0 0; padding: 15px 22px; }
    .vot-header-logo img { height: 30px; }
    #vot-summary { margin: 20px 22px 0; }
    .vot-summary-row { padding: 13px 18px; }
    .vot-row-label { width: 120px; }
    #vot-timeline { margin: 24px 22px 0; }
    .vot-step-label { font-size: 14px; }
}
