/* ═══════════════════════════════════════
   Sucursales - Mapa + Carrusel
   Solo se carga en páginas con mapa.
   ═══════════════════════════════════════ */

.sucursales-section {
    --suc-bg: #FBF7F0;
    --suc-accent: #D4A853;
    --suc-text: #2D1810;
    --suc-text-light: #6B4423;
    --suc-card-bg: #FFFFFF;
    --suc-btn: #2D1810;
    --suc-map-h-mobile: 70vh;
    --suc-map-h-desktop: 650px;
    --shadow-card: 0 4px 20px rgba(31, 17, 8, 0.12);
    --shadow-card-hover: 0 8px 32px rgba(31, 17, 8, 0.18);
    --radius-lg: 16px;
    --radius-xl: 20px;
    background: var(--suc-bg);
    padding: 48px 0 6rem;
    font-family: var(--cr-font-body, 'DM Sans', system-ui, sans-serif);
}

.sucursales-section *, .sucursales-section *::before, .sucursales-section *::after {
    box-sizing: border-box;
}

/* Header */
.sucursales-header {
    text-align: center;
    padding: 0 20px 32px;
}

.sucursales-header__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--suc-accent);
    margin-bottom: 12px;
}

.sucursales-header__title {
    font-family: var(--cr-font-display, 'Playfair Display', Georgia, serif);
    font-size: 32px;
    font-weight: 500;
    font-style: italic;
    color: var(--suc-text);
    line-height: 1.2;
}

/* Map container */
.sucursales-map-container {
    position: relative;
    width: 100%;
    height: var(--suc-map-h-mobile);
    min-height: 450px;
    max-height: 700px;
}

.sucursales-map__iframe,
.sucursales-map__leaflet {
    width: 100%;
    height: 100%;
    border: none;
}

/* Pin dorado personalizado */
.cr-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--suc-accent, #D4A853);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(45, 24, 16, 0.3);
}

.cr-marker__number {
    transform: rotate(45deg);
    font-family: var(--cr-font-display, 'Playfair Display', serif);
    font-size: 13px;
    font-weight: 700;
    color: #2D1810;
    line-height: 1;
}

.cr-marker--active {
    background: #2D1810;
    border-color: var(--suc-accent, #D4A853);
    transform: rotate(-45deg) scale(1.2);
    z-index: 1000 !important;
}

.cr-marker--active .cr-marker__number {
    color: #fff;
}

/* Popup personalizado */
.cr-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(45, 24, 16, 0.15);
    padding: 0;
}

.cr-popup .leaflet-popup-content {
    margin: 12px 16px;
    font-family: var(--cr-font-body, 'DM Sans', system-ui, sans-serif);
}

.cr-popup .leaflet-popup-tip {
    box-shadow: 0 4px 20px rgba(45, 24, 16, 0.1);
}

.cr-popup__name {
    font-family: var(--cr-font-display, 'Playfair Display', serif);
    font-size: 15px;
    font-weight: 600;
    color: #2D1810;
    margin-bottom: 4px;
}

.cr-popup__address {
    font-size: 12px;
    color: #6B4423;
    line-height: 1.4;
}

/* Carousel */
.sucursales-carousel {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 10;
}

.sucursales-carousel__track {
    display: flex;
    gap: 12px;
    padding: 0 16px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.sucursales-carousel__track::-webkit-scrollbar {
    display: none;
}

/* Card */
.sucursal-card {
    flex: 0 0 280px;
    scroll-snap-align: center;
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--suc-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.sucursal-card.is-active {
    border-color: var(--suc-accent);
    box-shadow: var(--shadow-card-hover);
}

.sucursal-card__image {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    background: var(--suc-bg);
}

.sucursal-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sucursal-card__number {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--suc-card-bg);
    border-radius: 50%;
    font-family: var(--cr-font-display, 'Playfair Display', serif);
    font-size: 12px;
    font-weight: 600;
    font-style: italic;
    color: var(--suc-text);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 1;
}

.sucursal-card.is-active .sucursal-card__number {
    background: var(--suc-accent);
}

.sucursal-card__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--suc-accent);
    border-radius: 50%;
    z-index: 1;
}

.sucursal-card__badge svg {
    width: 10px;
    height: 10px;
    fill: var(--suc-text);
}

.sucursal-card__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sucursal-card__name {
    font-family: var(--cr-font-display, 'Playfair Display', serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--suc-text);
    margin-bottom: 4px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.sucursal-card__address {
    font-size: 12px;
    color: var(--suc-text-light);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sucursal-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--suc-btn);
    color: var(--suc-card-bg);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.sucursal-card__cta:hover {
    opacity: 0.9;
}

.sucursal-card__cta svg {
    width: 12px;
    height: 12px;
}

/* Dots */
.sucursales-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 48px;
    background: var(--suc-bg);
}

.sucursales-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--suc-text);
    opacity: 0.25;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sucursales-dot.is-active {
    opacity: 1;
    background: var(--suc-accent);
    transform: scale(1.3);
}

/* ─── Responsive ─── */
@media (min-width: 768px) {
    .sucursales-section { padding: 64px 0 6rem; }
    .sucursales-header { padding: 0 40px 40px; }
    .sucursales-header__title { font-size: 44px; }
    .sucursales-map-container { height: 60vh; }
    .sucursales-carousel__track { gap: 16px; padding: 0 32px 8px; }
    .sucursal-card { flex: 0 0 320px; padding: 16px; }
    .sucursal-card__image { width: 88px; height: 88px; }
    .sucursal-card__address { font-size: 13px; }
}

@media (min-width: 1024px) {
    .sucursales-section { padding: 80px 60px 6rem; }
    .sucursales-header { padding: 0; max-width: 600px; margin: 0 auto 40px; }
    .sucursales-header__title { font-size: 52px; }

    .sucursales-map-container {
        display: grid;
        grid-template-columns: 280px 1fr;
        height: auto;
        min-height: var(--suc-map-h-desktop);
        max-height: none;
        border-radius: var(--radius-xl);
        overflow: hidden;
        box-shadow: 0 8px 40px rgba(31, 17, 8, 0.12);
    }

    .sucursales-map__iframe,
    .sucursales-map__leaflet {
        order: 2;
    }

    .sucursales-carousel {
        position: relative;
        bottom: auto;
        order: 1;
        background: var(--suc-card-bg);
    }

    .sucursales-carousel__track {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        max-height: var(--suc-map-h-desktop);
        scroll-snap-type: none;
        padding: 16px;
        gap: 12px;
    }

    .sucursal-card {
        flex: none;
        width: 100%;
        padding: 12px;
        gap: 10px;
    }

    .sucursal-card__image {
        width: 56px;
        height: 56px;
    }

    .sucursal-card__name {
        font-size: 14px;
        white-space: normal;
    }

    .sucursal-card__address {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }

    .sucursal-card__cta {
        font-size: 10px;
        padding: 5px 10px;
    }

    .sucursales-dots {
        display: none;
    }
}

@media (min-width: 1200px) {
    .sucursales-map-container {
        grid-template-columns: 300px 1fr;
    }
    .sucursal-card__image {
        width: 60px;
        height: 60px;
    }
}

/* Accessibility */
.sucursal-card:focus-visible {
    outline: 3px solid var(--suc-accent);
    outline-offset: 2px;
}

.sucursal-card__cta:focus-visible,
.sucursales-dot:focus-visible {
    outline: 2px solid var(--suc-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .sucursal-card,
    .sucursal-card__cta,
    .sucursales-dot {
        transition: none;
    }
    .sucursales-carousel__track {
        scroll-behavior: auto;
    }
}
