/* Selector locale contenido — public/themes (no depende de Tailwind JIT del partial) */

.vh-locale-switcher {
    position: relative;
    flex-shrink: 0;
}

.vh-locale-switcher__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 0.625rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #0f172a;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
    transition: color 0.15s ease;
}

.vh-locale-switcher__trigger:hover {
    color: #020617;
}

.vh-locale-switcher__trigger:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.vh-locale-switcher__icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    color: #4338ca;
}

.vh-locale-switcher__current-label {
    display: none;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0f172a;
}

@media (min-width: 1024px) {
    .vh-locale-switcher__trigger {
        gap: 0.625rem;
        padding: 0.5rem 0.75rem;
    }

    .vh-locale-switcher__current-label {
        display: inline;
    }
}

.vh-locale-switcher__panel {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    z-index: 50;
    box-sizing: border-box;
    width: min(calc(100vw - 1.5rem), 28rem);
    max-width: calc(100vw - 1.5rem);
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    overflow-x: hidden;
}

/* Móvil/tablet: panel centrado en viewport (evita desalineación con ancla derecha + overflow del header) */
@media (max-width: 1023px) {
    .vh-marketplace-page {
        --vh-locale-switcher-panel-top: calc(80px + 0.75rem);
    }

    .vh-locale-switcher__panel {
        position: fixed;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        top: calc(var(--vh-locale-switcher-panel-top, 5.25rem) + env(safe-area-inset-top, 0px));
        width: min(calc(100vw - 1.5rem), 28rem);
        max-width: calc(100vw - 1.5rem);
    }
}

.vh-locale-switcher__panel[hidden] {
    display: none !important;
}

.vh-locale-switcher__title {
    margin: 0 0 1rem;
    padding: 0 0.125rem;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}

.vh-locale-switcher__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
    max-height: min(24rem, 70vh);
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.vh-locale-switcher__item {
    min-width: 0;
}

.vh-locale-switcher__option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: #f3f4f6;
    color: #0f172a;
    text-decoration: none;
    overflow: hidden;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.vh-locale-switcher__option:hover {
    background: #e5e7eb;
}

.vh-locale-switcher__option:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.vh-locale-switcher__option.is-active {
    border-color: #4338ca;
    background: #eef2ff;
    font-weight: 700;
    padding-right: 1.75rem;
}

.vh-locale-switcher__flag {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    border-radius: 9999px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.vh-locale-switcher__label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.vh-locale-switcher__check {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    background: #4338ca;
    color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

.vh-locale-switcher__check svg {
    display: block;
}

@media (max-width: 480px) {
    .vh-locale-switcher__panel {
        width: min(calc(100vw - 1rem), 32rem);
        padding: 1rem;
    }

    .vh-locale-switcher__option {
        gap: 0.625rem;
        padding: 0.625rem 0.75rem;
    }

    .vh-locale-switcher__label {
        font-size: 0.875rem;
    }
}
