/* AVS Sell & Ship — Locale Switcher Widget */

.avs-ss-locale-widget {
    position: fixed;
    z-index: 99990;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
}

/* Positions */
.avs-ss-locale-widget--bottom-right { bottom: 24px; right: 24px; }
.avs-ss-locale-widget--bottom-left  { bottom: 24px; left: 24px;  }
.avs-ss-locale-widget--top-right    { top: 80px;    right: 24px; }
.avs-ss-locale-widget--top-left     { top: 80px;    left: 24px;  }

/* Trigger button */
.avs-ss-locale-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #d0d3d8;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    white-space: nowrap;
    transition: box-shadow .15s, border-color .15s;
    line-height: 1;
}
.avs-ss-locale-trigger:hover {
    border-color: #2271b1;
    box-shadow: 0 3px 12px rgba(0,0,0,.18);
}
.avs-ss-locale-trigger[aria-expanded="true"] {
    border-color: #2271b1;
    box-shadow: 0 3px 12px rgba(34,113,177,.25);
}

.avs-ss-locale-flag   { font-size: 18px; line-height: 1; }
.avs-ss-locale-label  { font-weight: 600; letter-spacing: .02em; }
.avs-ss-locale-sep    { color: #c3c4c7; margin: 0 2px; }
.avs-ss-locale-curr   { color: #2271b1; font-weight: 600; }
.avs-ss-locale-chevron {
    opacity: .5;
    transition: transform .2s;
    flex-shrink: 0;
}
.avs-ss-locale-trigger[aria-expanded="true"] .avs-ss-locale-chevron {
    transform: rotate(180deg);
}

/* Panel */
.avs-ss-locale-panel {
    position: absolute;
    background: #fff;
    border: 1px solid #d0d3d8;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.15);
    width: 270px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Tabs ── */
.avs-ss-locale-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid #f0f0f1;
}
.avs-ss-locale-tab {
    flex: 1;
    padding: 9px 4px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: #646970;
    transition: color .15s, border-color .15s;
    letter-spacing: .01em;
}
.avs-ss-locale-tab:hover {
    color: #1d2327;
}
.avs-ss-locale-tab--active {
    color: #2271b1;
    border-bottom-color: #2271b1;
    font-weight: 600;
}

/* ── Sections ── */
.avs-ss-locale-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}
.avs-ss-locale-section--hidden {
    display: none;
}

/* Panel position relative to trigger */
.avs-ss-locale-widget--bottom-right .avs-ss-locale-panel,
.avs-ss-locale-widget--top-right .avs-ss-locale-panel {
    bottom: calc(100% + 8px);
    right: 0;
}
.avs-ss-locale-widget--bottom-left .avs-ss-locale-panel,
.avs-ss-locale-widget--top-left .avs-ss-locale-panel {
    bottom: calc(100% + 8px);
    left: 0;
}
.avs-ss-locale-widget--top-right .avs-ss-locale-panel,
.avs-ss-locale-widget--top-left .avs-ss-locale-panel {
    bottom: auto;
    top: calc(100% + 8px);
}

/* Check mark for active item */
.avs-ss-locale-item-check {
    color: #2271b1;
    font-size: 11px;
    margin-left: auto;
    padding-left: 4px;
    flex-shrink: 0;
}

/* Search */
.avs-ss-locale-search-wrap {
    padding: 8px 10px 6px;
    border-bottom: 1px solid #f0f0f1;
    flex-shrink: 0;
}
.avs-ss-locale-search {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1px solid #d0d3d8;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    color: #1d2327;
}
.avs-ss-locale-search:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,.15);
}

/* List */
.avs-ss-locale-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    flex: 1;
}
.avs-ss-locale-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background .1s;
    border-radius: 0;
}
.avs-ss-locale-item:hover,
.avs-ss-locale-item:focus {
    background: #f0f6fc;
    outline: none;
}
.avs-ss-locale-item--active {
    background: #f0f6fc;
    font-weight: 600;
    color: #2271b1;
}
.avs-ss-locale-item-flag {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}
.avs-ss-locale-item-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.avs-ss-locale-item-curr {
    font-size: 11px;
    color: #646970;
    white-space: nowrap;
    font-weight: 500;
}
.avs-ss-locale-item--active .avs-ss-locale-item-curr {
    color: #2271b1;
}

/* Loading state */
.avs-ss-locale-widget--loading .avs-ss-locale-trigger {
    opacity: .7;
    pointer-events: none;
}

/* Hidden utility */
.avs-ss-locale-panel[hidden] { display: none; }

/* Responsive */
@media (max-width: 480px) {
    .avs-ss-locale-widget--bottom-right { bottom: 16px; right: 16px; }
    .avs-ss-locale-widget--bottom-left  { bottom: 16px; left: 16px; }
    .avs-ss-locale-panel { width: calc(100vw - 32px); max-width: 280px; }
}

/* ── Mobile compact trigger — FAB (flag only) ── */
@media (max-width: 768px) {
    .avs-ss-locale-trigger {
        width: 46px;
        height: 46px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0,0,0,.20);
    }
    .avs-ss-locale-trigger .avs-ss-locale-label,
    .avs-ss-locale-trigger .avs-ss-locale-sep,
    .avs-ss-locale-trigger .avs-ss-locale-curr,
    .avs-ss-locale-trigger .avs-ss-locale-chevron { display: none; }
    .avs-ss-locale-trigger .avs-ss-locale-flag    { font-size: 22px; }
}

/* ── First-visit popup ── */
.avs-ss-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: avs-ss-fadein .2s ease;
}
.avs-ss-popup-overlay[hidden] { display: none; }

@keyframes avs-ss-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.avs-ss-popup {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.22);
    width: 100%;
    max-width: 460px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: avs-ss-slidein .25s ease;
}
@keyframes avs-ss-slidein {
    from { transform: translateY(18px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.avs-ss-popup-header {
    padding: 20px 20px 14px;
    border-bottom: 1px solid #f0f0f1;
    flex-shrink: 0;
}
.avs-ss-popup-title {
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.avs-ss-popup-subtitle {
    font-size: 12px;
    color: #646970;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.avs-ss-popup-body {
    overflow-y: auto;
    flex: 1;
    padding: 12px;
}

.avs-ss-popup-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
@media (max-width: 380px) {
    .avs-ss-popup-grid { grid-template-columns: repeat(2, 1fr); }
}

.avs-ss-popup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    text-align: center;
    border: 1px solid transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.avs-ss-popup-item:hover,
.avs-ss-popup-item:focus {
    background: #f0f6fc;
    outline: none;
}
.avs-ss-popup-item--detected {
    background: #f0f6fc;
    border-color: #2271b1;
}
.avs-ss-popup-item-flag { font-size: 24px; line-height: 1; }
.avs-ss-popup-item-name {
    font-size: 11px;
    color: #1d2327;
    line-height: 1.3;
    word-break: break-word;
}

.avs-ss-popup-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f0f1;
    flex-shrink: 0;
    text-align: center;
}
.avs-ss-popup-skip {
    background: none;
    border: 1px solid #d0d3d8;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 12px;
    color: #646970;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s, color .15s;
}
.avs-ss-popup-skip:hover { border-color: #646970; color: #1d2327; }

/* Google Translate cleanup — hide bar and badge */
.goog-te-banner-frame.skiptranslate { display: none !important; }
.skiptranslate { display: none !important; }
body { top: 0 !important; }
#goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
