/* ============================================================
   Ventova Store — Sucursales (Styles)
   ============================================================ */

/* ── Hide WooCommerce Variation Select Globally ── */
table.variations select[name="attribute_pa_sucursal"],
table.variations .value select#pa_sucursal {
    display: none !important;
}

table.variations tr:has(select#pa_sucursal),
table.variations tr:has(select[name="attribute_pa_sucursal"]) {
    display: none !important;
}
/* ── Layout Wrapper ── */
.vs-sucursal-dropdown-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--vs-space-md);
}

.vs-topbar .vs-sucursal-dropdown-wrapper {
    margin-bottom: 0;
}

.vs-sucursal-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vs-text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.vs-topbar .vs-sucursal-label {
    color: rgba(255, 255, 255, 0.7);
}

.vs-sucursal-label i {
    color: var(--vs-accent);
}

/* ── Frontend Custom Selector Dropdown ── */
.vs-custom-select-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    width: auto;
}

.vs-custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--vs-bg-white);
    padding: 8px 14px;
    border-radius: 50px;
    border: 1px solid var(--vs-border);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vs-primary);
    transition: all 0.2s ease;
    user-select: none;
    min-width: 140px;
}

.vs-custom-select-trigger:hover {
    border-color: var(--vs-primary);
    box-shadow: var(--vs-shadow-sm);
}

.vs-topbar .vs-custom-select-trigger {
    background: rgba(255, 255, 255, 0.08); /* Transparent glassy layer */
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 4px 12px;
}

.vs-topbar .vs-custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.vs-select-icon {
    font-size: 0.75rem;
    color: var(--vs-text-light);
    transition: transform 0.2s ease;
}

.vs-topbar .vs-select-icon {
    color: rgba(255, 255, 255, 0.7);
}

.vs-custom-select-wrapper.open .vs-select-icon {
    transform: rotate(180deg);
}

.vs-custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: max-content;
    min-width: 100%;
    background: var(--vs-bg-white);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius-md);
    box-shadow: var(--vs-shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.vs-topbar .vs-custom-select-options {
    right: 0;
    left: auto; /* Align to right in topbar to prevent screen overflow */
}

.vs-custom-select-wrapper.open .vs-custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vs-custom-option {
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--vs-text);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.vs-custom-option:hover {
    background: var(--vs-bg);
    color: var(--vs-primary);
}

.vs-custom-option.selected {
    background: rgba(26, 60, 143, 0.05);
    color: var(--vs-primary);
    font-weight: 700;
}

/* ── Global Popup Modal ── */
.vs-sucursal-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vs-sucursal-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.vs-sucursal-popup-card {
    background: var(--vs-bg-white);
    border-radius: var(--vs-radius-lg);
    padding: var(--vs-space-xl);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    text-align: center;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vs-sucursal-popup-overlay.active .vs-sucursal-popup-card {
    transform: translateY(0) scale(1);
}

.vs-sucursal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--vs-border-light);
    border: none;
    color: var(--vs-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vs-sucursal-close:hover {
    background: var(--vs-border);
    color: var(--vs-text);
}

.vs-sucursal-popup-icon {
    width: 64px;
    height: 64px;
    background: rgba(247, 168, 37, 0.15);
    /* Accent tint */
    color: var(--vs-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto var(--vs-space-md);
}

.vs-sucursal-popup-title {
    font-size: 1.25rem;
    margin-bottom: var(--vs-space-sm);
    color: var(--vs-bg-dark);
}

.vs-sucursal-popup-desc {
    font-size: 0.9rem;
    color: var(--vs-text-muted);
    margin-bottom: var(--vs-space-lg);
}

.vs-sucursal-popup-list {
    display: flex;
    flex-direction: column;
    gap: var(--vs-space-sm);
}

.vs-sucursal-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

/* ─────────────────────────────────────────────────────────────
   Disponibilidad cruzada: "Disponible en otra sucursal" + CTA
   Se renderiza cuando la sucursal actual no tiene stock pero
   otra sí (ver sucursal-sync.js → renderUnavailable).
   ───────────────────────────────────────────────────────────── */
.woocommerce-variation-availability.vs-avail-other {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--vs-radius-md, 8px);
}

.vs-avail-other .vs-stock-other {
    margin: 0;
    font-weight: 600;
    color: var(--vs-text, #1f2937);
    background: none;
    padding: 0;
    font-size: 0.92rem;
}

.vs-avail-other .vs-stock-other::before {
    content: "\f3c5"; /* fa-map-marker-alt */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    color: var(--vs-accent, #f59e0b);
}

.vs-avail-other .vs-switch-sucursal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    border-radius: var(--vs-radius-md, 8px);
    cursor: pointer;
    align-self: flex-start;
}