/* =============================================================
 * Subdomain Translator — Switcher & Banner Styles
 * Reset cục bộ để không bị theme ghi đè.
 * Dùng z-index cao (2147483000+) để luôn nổi trên content.
 * ============================================================= */

.sdt-switcher,
.sdt-switcher * {
    box-sizing: border-box;
}

.sdt-switcher {
    position: fixed;
    z-index: 2147483000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #1a1a1a;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.sdt-switcher[data-sdt-ready="1"] {
    visibility: visible;
    opacity: 1;
}

/* Vị trí */
.sdt-switcher.sdt-pos-bottom-right { bottom: 20px; right: 20px; }
.sdt-switcher.sdt-pos-bottom-left  { bottom: 20px; left: 20px; }
.sdt-switcher.sdt-pos-top-right    { top: 20px; right: 20px; }
.sdt-switcher.sdt-pos-top-left     { top: 20px; left: 20px; }

/* Inline mode (shortcode) */
.sdt-switcher.sdt-inline,
.sdt-switcher.sdt-inline-static {
    position: relative;
    display: inline-block;
    bottom: auto; top: auto; left: auto; right: auto;
    z-index: 100;
}

/* Nút toggle */
.sdt-switcher .sdt-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.sdt-switcher .sdt-toggle:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
}

.sdt-switcher .sdt-toggle:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.sdt-switcher .sdt-toggle[aria-expanded="true"] .sdt-caret {
    transform: rotate(180deg);
}

.sdt-switcher .sdt-flag {
    font-size: 18px;
    line-height: 1;
}

.sdt-switcher .sdt-code {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.sdt-switcher .sdt-name {
    font-weight: 500;
}

.sdt-switcher .sdt-caret {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.15s ease;
}

/* Dropdown */
.sdt-switcher .sdt-dropdown {
    position: absolute;
    min-width: 180px;
    margin: 6px 0 0 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
    max-height: 320px;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

/* Dropdown mở */
.sdt-switcher .sdt-toggle[aria-expanded="true"] + .sdt-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0s;
}

/* Dropdown alignment theo position */
.sdt-switcher.sdt-pos-bottom-right .sdt-dropdown,
.sdt-switcher.sdt-pos-top-right .sdt-dropdown {
    right: 0;
}
.sdt-switcher.sdt-pos-bottom-left .sdt-dropdown,
.sdt-switcher.sdt-pos-top-left .sdt-dropdown {
    left: 0;
}
.sdt-switcher.sdt-pos-bottom-right .sdt-dropdown,
.sdt-switcher.sdt-pos-bottom-left .sdt-dropdown {
    bottom: 100%;
    margin: 0 0 6px 0;
    transform: translateY(4px);
}
.sdt-switcher.sdt-pos-bottom-right .sdt-toggle[aria-expanded="true"] + .sdt-dropdown,
.sdt-switcher.sdt-pos-bottom-left  .sdt-toggle[aria-expanded="true"] + .sdt-dropdown {
    transform: translateY(0);
}

/* Item trong dropdown */
.sdt-switcher .sdt-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.1s ease;
}
.sdt-switcher .sdt-item:hover,
.sdt-switcher .sdt-item:focus-visible {
    background: #f5f5f7;
    outline: none;
}
.sdt-switcher .sdt-item.sdt-current {
    background: #f0f4ff;
    font-weight: 600;
}
.sdt-switcher .sdt-item.sdt-missing {
    opacity: 0.55;
}
.sdt-switcher .sdt-item.sdt-missing .sdt-meta {
    font-size: 11px;
    color: #888;
}
.sdt-switcher .sdt-item .sdt-item-name {
    flex: 1;
    min-width: 0;
}
.sdt-switcher .sdt-item .sdt-check {
    color: #2271b1;
    font-weight: 700;
}

/* Dark mode auto */
@media (prefers-color-scheme: dark) {
    .sdt-switcher .sdt-toggle {
        background: #1f1f23;
        border-color: #38383d;
        color: #e8e8ed;
    }
    .sdt-switcher .sdt-dropdown {
        background: #1f1f23;
        border-color: #38383d;
    }
    .sdt-switcher .sdt-item {
        color: #e8e8ed;
    }
    .sdt-switcher .sdt-item:hover,
    .sdt-switcher .sdt-item:focus-visible {
        background: #2a2a30;
    }
    .sdt-switcher .sdt-item.sdt-current {
        background: #1e2a44;
    }
}

/* Mobile: nút nhỏ hơn */
@media (max-width: 600px) {
    .sdt-switcher.sdt-pos-bottom-right { bottom: 14px; right: 14px; }
    .sdt-switcher.sdt-pos-bottom-left  { bottom: 14px; left: 14px; }
    .sdt-switcher .sdt-toggle { padding: 8px 12px; font-size: 13px; }
}

/* =============================================================
 * Banner gợi ý ngôn ngữ
 * ============================================================= */

.sdt-banner {
    position: fixed;
    z-index: 2147482999;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f1f23;
    color: #fff;
    padding: 14px 20px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transform: translateY(100%);
    transition: transform 0.25s ease-out;
}
.sdt-banner.sdt-banner-visible {
    transform: translateY(0);
}
.sdt-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.sdt-banner-text {
    flex: 1;
    min-width: 220px;
}
.sdt-banner-text .sdt-banner-flag {
    font-size: 18px;
    margin-right: 6px;
}
.sdt-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sdt-banner-cta {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
}
.sdt-banner-cta:hover { background: #135e96; }
.sdt-banner-close {
    background: transparent;
    color: #c7c7cc;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    font: inherit;
}
.sdt-banner-close:hover { color: #fff; }

@media (max-width: 600px) {
    .sdt-banner { padding: 12px 14px; font-size: 13px; }
    .sdt-banner-inner { gap: 10px; }
}
