/**
 * SGC API Tracking - Stylesheet tổng hợp (v1.0.0)
 * Saigon Corp Logistics & Express - màu chủ đạo: #e21f2f (đỏ) + #1b75bb (xanh)
 *
 * Giao diện Mẫu 2: hero band đỏ, thanh tiến trình ngang 4 bước, thẻ thông tin,
 * lịch sử giờ-sự kiện. Toàn bộ CSS nằm tại đây (không inline trong template)
 * để trình duyệt cache được. File được enqueue CHỈ trên trang có shortcode.
 *
 * Bố cục file:
 *  1. Loading overlay
 *  2. Hero + form tra cứu
 *  3. Hộp thông báo lỗi
 *  4. Kết quả: tóm tắt + stepper + thẻ thông tin
 *  5. Lịch sử hành trình + POD
 *  6. Lightbox xem ảnh
 *  7. Responsive / A11y / Print
 */

/* ============ 1. Loading overlay ============ */
.sgc-loading { position: fixed; z-index: 999999; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; }
.sgc-loading::after { content: ""; width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top: 4px solid #e21f2f; border-radius: 50%; animation: sgc-spin 1s linear infinite; }

@keyframes sgc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============ 2. Hero + form tra cứu ============ */
.sgc-tracking-container {
    --sgc-red: #e21f2f;
    --sgc-red-dark: #b8121f;
    --sgc-red-deep: #8f0d18;
    --sgc-red-tint: #fdeaec;
    --sgc-red-tint-2: #f9d2d6;
    --sgc-blue: #1b75bb;
    --sgc-blue-dark: #135e99;
    --sgc-blue-tint: #e7f1f9;
    --sgc-ink: #27272e;
    --sgc-ink-soft: #6b6b76;
    --sgc-line: #e8e2e3;
    --sgc-surface: #ffffff;
    --sgc-surface-2: #faf7f7;
    --sgc-green: #1a9c4b;
    --sgc-green-tint: #e5f6ec;
    --sgc-amber: #b97a0a;
    --sgc-amber-tint: #fdf3e0;
    --sgc-shadow: 0 3px 12px rgba(143, 13, 24, 0.10);

    max-width: 920px;
    margin: 0 auto;
    padding: 14px 12px 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--sgc-ink);
    line-height: 1.45;
    box-sizing: border-box;
}

.sgc-tracking-container *,
.sgc-tracking-container *::before,
.sgc-tracking-container *::after { box-sizing: border-box; }

.sgc-hero {
    background: linear-gradient(120deg, var(--sgc-red-deep), var(--sgc-red) 65%, var(--sgc-red-dark));
    border-radius: 12px;
    padding: 22px 24px 24px;
    color: #fff;
    box-shadow: var(--sgc-shadow);
}

.sgc-hero-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sgc-hero-title svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 1.8; }

.sgc-hero-sub { margin: 0 0 14px; font-size: 12.5px; color: rgba(255, 255, 255, 0.85); }
.sgc-hero-sub strong { color: #ffd9dd; font-weight: 700; }

.sgc-track-form { margin: 0; }

.sgc-form-row { display: flex; gap: 10px; }

/* !important + selector độ ưu tiên cao cho nền/chữ: input nằm trên band ĐỎ -
   nếu theme đè background thành transparent (rất phổ biến) thì ô nhập sẽ ăn
   màu đỏ của band, chữ xám trên nền đỏ không đọc được. Ép cứng nền TRẮNG. */
.sgc-tracking-container .sgc-hero input.sgc-input-track,
.sgc-input-track {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #27272e !important;
    background: #fff !important;
    background-color: #fff !important;
    border: none !important;
    border-radius: 8px;
    outline: none;
    box-shadow: none;
    transition: box-shadow 0.2s ease;
    -webkit-text-fill-color: #27272e; /* Safari: chống theme đổi màu chữ */
}

/* Focus trên nền band đỏ: giữ nguyên NỀN TRẮNG (ép !important), thêm vòng
   trắng đậm + khe hở tối mỏng để tách ô khỏi nền cho dễ nhìn */
.sgc-tracking-container .sgc-hero input.sgc-input-track:focus,
.sgc-tracking-container .sgc-hero input.sgc-input-track:active,
.sgc-input-track:focus,
.sgc-input-track:focus-within,
.sgc-input-track:active {
    background: #fff !important;
    background-color: #fff !important;
    color: #27272e !important;
    box-shadow: 0 0 0 2px rgba(143, 13, 24, 0.9), 0 0 0 5px rgba(255, 255, 255, 0.95);
}
.sgc-input-track::placeholder { color: #8a8a94; font-weight: 400; letter-spacing: 0; opacity: 1; }
/* Chrome autofill hay tô nền vàng/xanh - ép về trắng */
.sgc-input-track:-webkit-autofill,
.sgc-input-track:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px #fff inset;
    -webkit-text-fill-color: #27272e;
}
.sgc-input-track.error { box-shadow: 0 0 0 2px rgba(143, 13, 24, 0.9), 0 0 0 5px #ffd600; }
.sgc-input-track.success { box-shadow: 0 0 0 2px rgba(143, 13, 24, 0.9), 0 0 0 5px #7ce6a0; }

.sgc-track-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 46px;
    padding: 0 24px;
    background: var(--sgc-blue);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
    position: relative;
}

.sgc-track-btn:hover { background: var(--sgc-blue-dark); color: #fff !important; }
.sgc-track-btn .sgc-arrow-icon { width: 20px; height: 13px; }

.sgc-track-btn.loading { pointer-events: none; opacity: 0.75; }
.sgc-track-btn.loading span,
.sgc-track-btn.loading .sgc-arrow-icon { opacity: 0; }
.sgc-track-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sgc-spin 1s linear infinite;
}

.sgc-tracking-result { width: 100%; }
.sgc-tracking-result:empty { display: none; }

/* ============ 3. Hộp thông báo lỗi (dùng chung AJAX + server-side) ============ */
.sgc-error-box {
    margin-top: 14px;
    background: var(--sgc-surface, #ffffff);
    border: 1px solid var(--sgc-line, #e8e2e3);
    border-left: 4px solid var(--sgc-red, #e21f2f);
    border-radius: 10px;
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 24px;
}

.sgc-error-box h3 { margin: 0; font-size: 15px; color: var(--sgc-red, #e21f2f); font-weight: 700; }
.sgc-error-box p { margin: 0; font-size: 13.5px; color: var(--sgc-ink, #27272e); }
.sgc-error-box .sgc-error-code { font-weight: 700; color: var(--sgc-blue, #1b75bb); letter-spacing: 0.04em; }

.sgc-error-hotline {
    background: var(--sgc-blue-tint, #e7f1f9);
    border-radius: 7px;
    padding: 6px 14px;
    font-size: 13.5px;
    white-space: nowrap;
    color: var(--sgc-ink, #27272e);
}

.sgc-error-hotline a { color: var(--sgc-blue, #1b75bb); font-weight: 800; text-decoration: none; }
.sgc-error-hotline a:hover { text-decoration: underline; }

.sgc-error-thanks {
    flex-basis: 100%;
    font-style: italic;
    color: var(--sgc-ink-soft, #6b6b76) !important;
    margin: 2px 0 0 !important;
}

/* ============ 4. Kết quả: tóm tắt + stepper + thẻ thông tin ============ */
.sgc-result-wrapper {
    --sgc-red: #e21f2f;
    --sgc-red-dark: #b8121f;
    --sgc-red-deep: #8f0d18;
    --sgc-red-tint: #fdeaec;
    --sgc-red-tint-2: #f9d2d6;
    --sgc-blue: #1b75bb;
    --sgc-blue-dark: #135e99;
    --sgc-blue-tint: #e7f1f9;
    --sgc-ink: #27272e;
    --sgc-ink-soft: #6b6b76;
    --sgc-line: #e8e2e3;
    --sgc-surface: #ffffff;
    --sgc-surface-2: #faf7f7;
    --sgc-green: #1a9c4b;
    --sgc-green-tint: #e5f6ec;
    --sgc-amber: #b97a0a;
    --sgc-amber-tint: #fdf3e0;

    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.45;
    color: var(--sgc-ink);
}

.sgc-result-wrapper *,
.sgc-result-wrapper *::before,
.sgc-result-wrapper *::after { box-sizing: border-box; }

.sgc-result-box {
    margin-top: 14px;
    background: var(--sgc-surface);
    border: 1px solid var(--sgc-line);
    border-radius: 12px;
    overflow: hidden;
}

.sgc-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--sgc-line);
}

.sgc-code { font-size: 16px; font-weight: 800; letter-spacing: 0.05em; color: var(--sgc-red); }
.sgc-code small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--sgc-ink-soft);
    text-transform: uppercase;
}

.sgc-eta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; color: var(--sgc-ink-soft); text-align: right; }
.sgc-eta-line b { color: var(--sgc-ink); }

/* Badge trạng thái - border-radius 20px cũng là "đầu dò" cho cơ chế tự chữa
   lành CSS (script inline kiểm tra selector này có được áp dụng không) */
.sgc-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--sgc-surface-2);
    color: var(--sgc-ink-soft);
}

.sgc-status-badge.status-delivered { background: var(--sgc-green-tint); color: var(--sgc-green); }
.sgc-status-badge.status-processing { background: var(--sgc-amber-tint); color: var(--sgc-amber); }
.sgc-status-badge.status-pending { background: var(--sgc-blue-tint); color: var(--sgc-blue); }
.sgc-status-badge.status-cancelled { background: var(--sgc-red-tint); color: var(--sgc-red); }

/* --- Thanh tiến trình ngang --- */
.sgc-stepper { display: flex; padding: 20px 22px 6px; }

.sgc-stage { flex: 1; text-align: center; position: relative; }

.sgc-stage::before {
    content: "";
    position: absolute;
    top: 19px;
    left: -50%;
    width: 100%;
    height: 3px;
    background: var(--sgc-line);
}

.sgc-stage:first-child::before { display: none; }
.sgc-stage.done::before { background: var(--sgc-red); }

.sgc-stage-dot {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: var(--sgc-surface-2);
    border: 2px solid var(--sgc-line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sgc-ink-soft);
}

.sgc-stage-dot svg { width: 19px; height: 19px; stroke: currentColor; fill: none; }
.sgc-stage.done .sgc-stage-dot { background: var(--sgc-red); border-color: var(--sgc-red); color: #fff; }
.sgc-stage.now .sgc-stage-dot { box-shadow: 0 0 0 5px var(--sgc-red-tint-2); }

.sgc-stage-lb { font-size: 12px; font-weight: 600; color: var(--sgc-ink-soft); }
.sgc-stage.done .sgc-stage-lb { color: var(--sgc-red); font-weight: 700; }
.sgc-stage-tm { font-size: 11px; color: var(--sgc-ink-soft); font-variant-numeric: tabular-nums; }

/* --- 2 thẻ thông tin --- */
.sgc-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px 22px 18px;
}

.sgc-card {
    background: var(--sgc-surface-2);
    border-left: 3px solid var(--sgc-red);
    border-radius: 8px;
    padding: 10px 14px;
}

.sgc-card h4 {
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sgc-ink-soft);
}

.sgc-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; }
.sgc-line .k { color: var(--sgc-ink-soft); white-space: nowrap; }
.sgc-line .v { font-weight: 700; text-align: right; overflow-wrap: break-word; min-width: 0; }
.sgc-line .v.blue { color: var(--sgc-blue); }

/* ============ 5. Lịch sử hành trình + POD ============ */
.sgc-history {
    margin-top: 14px;
    background: var(--sgc-surface);
    border: 1px solid var(--sgc-line);
    border-radius: 12px;
    padding: 16px 22px;
}

.sgc-history h3 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sgc-red);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sgc-history h3 span { font-size: 11px; color: var(--sgc-ink-soft); font-weight: 600; text-transform: none; letter-spacing: 0; }

.sgc-ev { display: flex; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--sgc-line); }
.sgc-ev:last-of-type { border-bottom: none; }

.sgc-ev-when { width: 106px; flex-shrink: 0; text-align: right; }
.sgc-ev-when .d { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sgc-ev-when .h { font-size: 12px; color: var(--sgc-ink-soft); font-variant-numeric: tabular-nums; }

.sgc-ev-what { border-left: 2px solid var(--sgc-line); padding-left: 16px; position: relative; min-width: 0; }
.sgc-ev-what::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sgc-ink-soft);
}

.sgc-ev.cur .sgc-ev-what::before { background: var(--sgc-red); box-shadow: 0 0 0 3px var(--sgc-red-tint-2); }
.sgc-ev.cur .sgc-ev-what { border-left-color: var(--sgc-red-tint-2); }

.sgc-ev-what .t { font-size: 13.5px; font-weight: 700; margin: 0; }
.sgc-ev.cur .sgc-ev-what .t { color: var(--sgc-red); }
.sgc-ev-what .n { font-size: 12.5px; color: var(--sgc-ink-soft); margin: 0; }
.sgc-ev.cur .sgc-ev-what .n { color: var(--sgc-green); font-weight: 600; }

/* --- POD strip --- */
.sgc-pod-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--sgc-line);
}

.sgc-pod-lbl { font-size: 12px; font-weight: 700; color: var(--sgc-ink-soft); margin-right: 4px; }

.sgc-pod-images { display: flex; gap: 8px; flex-wrap: wrap; }

.sgc-pod-image-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    width: 56px;
    height: 56px;
    border: 1px solid var(--sgc-line);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.sgc-pod-image-item:hover {
    border-color: var(--sgc-red);
    box-shadow: 0 4px 14px rgba(143, 13, 24, 0.22);
}

/* !important: theme WordPress hay có rule img { height:auto!important } đè
   mất height:100% khiến ảnh dọc bị cắt đáy, ảnh ngang hụt khoảng trắng */
.sgc-pod-image-item img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    transition: transform 0.25s ease;
}

.sgc-pod-image-item:hover img { transform: scale(1.08); }

.sgc-pod-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(143, 13, 24, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.sgc-pod-image-item:hover .sgc-pod-overlay { background: rgba(143, 13, 24, 0.42); }

.sgc-pod-zoom-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #e21f2f;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.sgc-pod-image-item:hover .sgc-pod-zoom-badge { opacity: 1; transform: scale(1); }
.sgc-pod-zoom-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; }

/* ============ 6. Lightbox - frosted glass toàn màn hình ============ */
.sgc-lightbox {
    display: none;
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999999;
    flex-direction: column; /* JS bật bằng display:flex */
    box-sizing: border-box;
}

@supports (height: 100dvh) {
    .sgc-lightbox { height: 100dvh !important; max-height: 100dvh !important; }
}

.sgc-lightbox *,
.sgc-lightbox *::before,
.sgc-lightbox *::after { box-sizing: border-box; }

.sgc-lightbox-topbar,
.sgc-lightbox-bottombar { flex: 0 0 auto; }

.sgc-lightbox-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(18, 8, 9, 0.93);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.sgc-lb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #f4eced;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    padding: 0;
}

.sgc-lb-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sgc-lb-btn:hover { background: rgba(255, 255, 255, 0.20); transform: translateY(-1px); }
.sgc-lb-btn:active { transform: translateY(0); }

.sgc-lightbox-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(rgba(0, 0, 0, 0.55), transparent);
}

.sgc-lightbox-counter {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #f4eced;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
}

.sgc-lb-close:hover { background: #e21f2f; border-color: #e21f2f; color: #fff; }

.sgc-lightbox-content {
    position: relative;
    z-index: 1;
    flex: 1 1 0%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0 !important;
    max-height: 100%;
    overflow: hidden;
    /* KHÔNG đặt touch-action:none - chụm 2 ngón để trình duyệt zoom tự nhiên;
       lỗi nhảy ảnh khi chụm đã xử lý trong JS bằng cách hủy swipe khi cử chỉ
       có >= 2 ngón */
}

.sgc-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    min-width: 0;
    padding: 8px 76px;
    overflow: hidden;
    position: relative;
}

#sgc-lightbox-image {
    /* !important: theme hay có rule img phá giới hạn kích thước. Chốt thêm
       mức trần theo viewport để ảnh không bao giờ vượt quá màn hình. */
    max-width: 100% !important;
    max-height: calc(100vh - 230px) !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.15s ease-out, opacity 0.3s ease;
    user-select: none;
    will-change: transform;
}

@supports (height: 100dvh) {
    #sgc-lightbox-image { max-height: calc(100dvh - 230px) !important; }
}

.sgc-lightbox-loading { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.sgc-spinner { width: 44px; height: 44px; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: #f0505e; border-radius: 50%; animation: sgc-spin 0.8s linear infinite; }

.sgc-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #f4eced;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
    padding: 0;
}

.sgc-lb-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sgc-lb-nav:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-50%) scale(1.06); }
.sgc-prev-btn { left: 16px; }
.sgc-next-btn { right: 16px; }

.sgc-lightbox-bottombar {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

.sgc-lb-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(32, 18, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.sgc-zoom-display {
    color: #f6b3b9;
    font-weight: 700;
    font-size: 13px;
    min-width: 50px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.sgc-lb-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.12); margin: 0 5px; }

/* !important cho màu chữ: link trong theme WordPress thường đè màu <a> */
.sgc-lb-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px;
    border-radius: 10px;
    background: #1b75bb;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13.5px;
    font-weight: 600;
    transition: background 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.sgc-lb-download svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sgc-lb-download span { color: #fff !important; }
.sgc-lb-download:hover,
.sgc-lb-download:focus,
.sgc-lb-download:visited { background: #135e99; transform: translateY(-1px); color: #fff !important; text-decoration: none !important; }

.sgc-thumbnails {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.sgc-thumb {
    width: 54px;
    height: 54px;
    border-radius: 9px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
    opacity: 0.5;
}

.sgc-thumb:hover { opacity: 0.85; transform: translateY(-2px); }
.sgc-thumb.active { border-color: #f0505e; opacity: 1; box-shadow: 0 0 14px rgba(240, 80, 94, 0.45); }
.sgc-thumb img { width: 100% !important; height: 100% !important; max-height: 100% !important; object-fit: cover; display: block; margin: 0 !important; }

/* ============ 7. Responsive / A11y / Print ============ */
@media only screen and (max-width: 760px) {
    .sgc-tracking-container { padding: 10px 8px 18px; }
    .sgc-hero { padding: 18px 16px 20px; border-radius: 10px; }
    .sgc-form-row { flex-direction: column; align-items: stretch; }
    .sgc-track-btn { width: 100%; }

    .sgc-result-top { padding: 10px 14px; }
    .sgc-eta { align-items: flex-start; text-align: left; }
    .sgc-stepper { padding: 16px 10px 4px; }
    .sgc-stage-lb { font-size: 10.5px; }
    .sgc-stage-tm { display: none; }
    .sgc-stage-dot { width: 34px; height: 34px; }
    .sgc-stage::before { top: 16px; }
    .sgc-info { grid-template-columns: 1fr; padding: 12px 14px 16px; }
    .sgc-history { padding: 14px; }
    .sgc-ev-when { width: 84px; }

    .sgc-lightbox-topbar { padding: 10px 12px; }
    .sgc-lightbox-counter { font-size: 12.5px; padding: 6px 12px; }
    .sgc-lb-btn { width: 34px; height: 34px; border-radius: 9px; }
    .sgc-lb-btn svg { width: 16px; height: 16px; }
    .sgc-lb-nav { width: 40px; height: 40px; }
    .sgc-lb-nav svg { width: 19px; height: 19px; }
    .sgc-prev-btn { left: 8px; }
    .sgc-next-btn { right: 8px; }
    .sgc-image-wrapper { padding: 6px 54px; }
    .sgc-zoom-display { font-size: 12px; min-width: 42px; }
    .sgc-lb-download { height: 34px; padding: 0 14px; font-size: 12.5px; }
    .sgc-thumb { width: 46px; height: 46px; }
    .sgc-lightbox-bottombar { padding: 8px 10px 12px; gap: 8px; }
}

@media (max-width: 480px) {
    .sgc-hero-title { font-size: 16px; }
    .sgc-line { font-size: 12.5px; }
    .sgc-ev-when { width: 76px; }
    .sgc-ev-when .d { font-size: 12px; }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .sgc-input-track { border: 2px solid #000; }
    .sgc-track-btn { background: #000; border: 2px solid #000; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sgc-input-track,
    .sgc-track-btn,
    .sgc-pod-image-item img,
    .sgc-pod-zoom-badge,
    .sgc-lb-btn,
    .sgc-lb-nav,
    .sgc-thumb { transition: none; }
    .sgc-track-btn.loading::after { animation: none; }
}

/* Focus visible */
/* Input nằm trên band ĐỎ nên không dùng outline đỏ (lẫn vào nền khó nhìn) -
   trạng thái focus đã có vòng trắng đậm từ box-shadow ở trên */
.sgc-input-track:focus-visible { outline: none; }

.sgc-track-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.sgc-lb-btn:focus-visible,
.sgc-lb-nav:focus-visible {
    outline: 2px solid #f0505e;
    outline-offset: 2px;
}

@media print {
    .sgc-lightbox { display: none !important; }
    .sgc-result-box, .sgc-history { box-shadow: none; border: 1px solid #ccc; }
}
