﻿/* ==========================
   VARIABLES
========================== */

:root {
    --azul: #003F7F;
    --azul-oscuro: #002C6E;
    --azul-medio: #0057B0;
    --azul-claro: #EAF3FF;
    --acento: #E8B84B;
    --gris-bg: #F4F6FA;
    --gris-borde: #E2E8F0;
    --gris-texto: #5A6478;
    --gris-suave: #F8FAFC;
    --blanco: #FFFFFF;
    --sombra: 0 8px 28px rgba(0, 63, 127, 0.10);
    --sombra-hover: 0 16px 38px rgba(0, 63, 127, 0.16);
}

/* ==========================
   CONTENEDOR GENERAL
========================== */

.col-12 > .container.bg-white {
    background: #ffffff !important;
    padding: 0 22px 36px;
    border-radius: 18px;
}

/* ==========================
   HERO
========================== */

.suc-hero {
    background: linear-gradient(135deg, #002C6E, #004A99);
    padding: 48px 22px 42px;
    text-align: center;
    border-radius: 0 0 28px 28px;
    margin-bottom: 34px;
    box-shadow: 0 16px 35px rgba(0, 44, 110, 0.16);
}

    .suc-hero h1 {
        font-size: clamp(1.8rem, 3vw, 2.55rem);
        font-weight: 800;
        color: var(--blanco);
        margin: 0 0 8px;
        font-family: "Myriad Pro", "Segoe UI", Arial, sans-serif;
        letter-spacing: -0.03em;
    }

    .suc-hero p {
        color: rgba(255, 255, 255, 0.78);
        font-size: .95rem;
        margin: 0;
        font-family: "Myriad Pro", "Segoe UI", Arial, sans-serif;
    }

/* ==========================
   TÍTULOS
========================== */

.suc-titulo {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--azul);
    margin: 24px 0 20px;
}

.map-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--azul);
    margin: 0 0 12px;
}

/* ==========================
   HORARIO GENERAL
========================== */

.horario-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.horario-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gris-bg);
    border: 1.5px solid #DDE3EF;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--azul);
}

/* ==========================
   GRID DE SUCURSALES
========================== */

.suc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 18px;
    margin-bottom: 42px;
}

/* ==========================
   TARJETAS DE SUCURSALES
========================== */

.suc-card {
    background: var(--blanco);
    border: 1px solid #E6EDF7;
    border-radius: 18px;
    padding: 19px 18px;
    box-shadow: 0 8px 22px rgba(0, 63, 127, 0.07);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    position: relative;
    overflow: hidden;
}

    .suc-card::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 4px;
        background: transparent;
    }

    .suc-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--sombra-hover);
        border-color: rgba(0, 87, 176, 0.25);
    }

    .suc-card.matriz::before {
        background: linear-gradient(180deg, var(--acento), #F59E0B);
    }

.badge-matriz,
.badge-especial {
    display: inline-block;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    width: fit-content;
}

.badge-matriz {
    background: rgba(232, 184, 75, 0.15);
    border: 1px solid rgba(232, 184, 75, 0.42);
    color: #92660A;
}

.badge-especial {
    background: rgba(26, 127, 212, 0.10);
    border: 1px solid rgba(26, 127, 212, 0.25);
    color: var(--azul-medio);
}

.suc-name {
    font-size: .98rem;
    font-weight: 800;
    color: var(--azul);
    margin: 0;
    line-height: 1.28;
}

.suc-info-row {
    font-size: .82rem;
    color: var(--gris-texto);
    line-height: 1.5;
    margin: 0;
}

    .suc-info-row a {
        color: var(--azul-medio);
        font-weight: 700;
        text-decoration: none;
    }

        .suc-info-row a:hover {
            text-decoration: underline;
        }

.suc-horario {
    background: #F3F6FB;
    border: 1px solid #E8EEF6;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: .78rem;
    color: var(--gris-texto);
    line-height: 1.6;
    margin: 0;
}

    .suc-horario strong {
        color: var(--azul);
    }

.btn-maps {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--azul-oscuro);
    color: var(--blanco) !important;
    font-size: .78rem;
    font-weight: 800;
    padding: 8px 15px;
    border-radius: 999px;
    text-decoration: none !important;
    margin-top: auto;
    transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
    width: fit-content;
    box-shadow: 0 8px 18px rgba(0, 44, 110, .18);
}

    .btn-maps:hover {
        opacity: .92;
        transform: translateY(-1px);
        box-shadow: 0 12px 24px rgba(0, 44, 110, .25);
    }

/* ==========================
   MAPA ANTERIOR SI EXISTE
========================== */

#map {
    width: 100%;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--sombra);
    border: 1.5px solid #E8EDF5;
}

/* ==========================
   SECCIÓN MAPA SUCURSALES
========================== */

.branch-map-section {
    margin-top: 42px;
    margin-bottom: 35px;
    font-family: "Segoe UI", Arial, sans-serif;
}

    .branch-map-section h3 {
        color: var(--azul-oscuro);
        font-size: 1.2rem;
        font-weight: 800;
        margin-bottom: 14px;
    }

/* Encabezado opcional */
.map-heading {
    margin-bottom: 16px;
}

    .map-heading span {
        display: inline-block;
        color: var(--azul-medio);
        font-size: .78rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .08em;
        margin-bottom: 5px;
    }

    .map-heading h2 {
        color: var(--azul-oscuro);
        font-size: clamp(1.35rem, 2vw, 1.85rem);
        font-weight: 800;
        margin: 0;
    }

    .map-heading p {
        color: #64748B;
        font-size: .92rem;
        margin: 6px 0 0;
    }

.interactive-map-card {
    display: grid;
    grid-template-columns: 250px 1fr;
    background: var(--blanco);
    border: 1px solid #DCE6F3;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0, 47, 108, 0.10);
}

/* ==========================
   PANEL IZQUIERDO
========================== */

.region-panel {
    background: #F5F7FB;
    border-right: 1px solid #D9E2EF;
    padding: 22px 18px;
}

    .region-panel h4,
    .region-panel .map-title {
        font-size: 1rem;
        font-weight: 800;
        color: #0B3F86;
        margin-bottom: 18px;
    }

.region-item {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    background: transparent;
    padding: 12px 14px 12px 16px;
    margin-bottom: 8px;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    color: #1F2D3D;
    box-shadow: none;
    transform: none;
    transition: all .22s ease;
}

    .region-item strong {
        display: block;
        font-size: 1rem;
        line-height: 1.1;
        color: #133B7A;
    }

    .region-item small {
        display: block;
        color: #6C7A90;
        font-size: .83rem;
        margin-top: 3px;
    }

.region-icon,
.region-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2F76D2;
    box-shadow: 0 0 0 5px rgba(47, 118, 210, 0.15);
    flex-shrink: 0;
}

.region-item:hover {
    background: #FFFFFF;
    border-color: #DBE4F0;
    transform: none;
    box-shadow: 0 8px 18px rgba(16, 52, 110, 0.08);
}

.region-item.active {
    background: #FFFFFF;
    border-color: #CFDCED;
    box-shadow: 0 10px 20px rgba(16, 52, 110, 0.10);
    transform: none;
}

    .region-item.active::before {
        content: "";
        position: absolute;
        left: 0;
        top: 10px;
        bottom: 10px;
        width: 4px;
        border-radius: 4px;
        background: #0B4EA2;
    }

    .region-item.active strong {
        color: #0A3E88;
    }

    .region-item.active small {
        color: #6C7A90;
    }

/* ==========================
   TIP DEL MAPA
========================== */

.map-tip {
    margin-top: 26px;
    padding: 13px;
    background: #FFFFFF;
    border: 1px solid #DBE4EF;
    border-radius: 14px;
    color: #5D6B80;
    font-size: .82rem;
    line-height: 1.4;
    display: flex;
    gap: 9px;
    align-items: center;
}

    .map-tip span {
        width: 10px;
        height: 10px;
        background: #2F76D2;
        border-radius: 50%;
        box-shadow: 0 0 0 5px rgba(47, 118, 210, 0.12);
        flex-shrink: 0;
    }

/* ==========================
   ZONA VISUAL DEL MAPA
========================== */

.map-visual {
    position: relative;
    padding: 20px;
    background: #F8FAFC;
    overflow: hidden;
}

.map-background {
    position: relative;
    height: 430px;
    border-radius: 24px;
    overflow: hidden;
    background: #FBFBFC;
    border: 1px solid #DFE7F0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.01);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contenedor proporcional del mapa */
.map-canvas {
    position: relative;
    width: 94%;
    max-width: 760px;
    aspect-ratio: 1448 / 1086;
}

    /* Imagen del mapa */
    .map-canvas .figure-img {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
        margin: 0 !important;
        max-width: none !important;
        display: block !important;
        z-index: 1;
    }

/* Oculta figuras viejas */
.map-shape,
.shape-1,
.shape-2,
.shape-3,
.shape-4,
.route-lines {
    display: none !important;
}

/* ==========================
   PINES 
========================== */

.map-pin {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    z-index: 20 !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    animation: none !important;
    transform: none !important;
}

    .map-pin::before {
        content: "" !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        width: 26px !important;
        height: 26px !important;
        background: linear-gradient(180deg, #0B5FB8, #003F7F) !important;
        border: 3px solid #FFFFFF !important;
        border-radius: 50% 50% 50% 0 !important;
        transform: translate(-50%, -50%) rotate(-45deg) !important;
        box-shadow: 0 10px 22px rgba(0, 63, 127, 0.28) !important;
        transition: all .2s ease !important;
    }

    .map-pin::after {
        content: "" !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        width: 9px !important;
        height: 9px !important;
        background: #FFFFFF !important;
        border-radius: 50% !important;
        transform: translate(-50%, -50%) !important;
        z-index: 2 !important;
    }

    .map-pin span {
        display: none !important;
    }

    .map-pin:hover::before,
    .map-pin.active::before {
        background: linear-gradient(180deg, #003F7F, #002C6E) !important;
        transform: translate(-50%, -50%) rotate(-45deg) scale(1.12) !important;
        box-shadow: 0 14px 28px rgba(0, 44, 110, 0.34) !important;
    }

/* ==========================
pines de mapa
   SL = San Luis Potosí
   MT = Matehuala
   RV = Rioverde
========================== */

.pin-slp {
    left: 32% !important;
    top: 54% !important;
}

.pin-matehuala {
    left: 47% !important;
    top: 29% !important;
}

.pin-rioverde {
    left: 54% !important;
    top: 79% !important;
}

.map-pin[data-name="San Luis Potosí"] {
    left: 32% !important;
    top: 54% !important;
}

.map-pin[data-name="Matehuala"] {
    left: 47% !important;
    top: 29% !important;
}

.map-pin[data-name="Rioverde"],
.map-pin[data-name="Rio Verde"] {
    left: 54% !important;
    top: 79% !important;
}

/* Oculta pines extra si todavía existieran */
.map-pin[data-name="Sucursal Chapultepec"],
.map-pin[data-name="Sucursal Gálvez"] {
    display: none !important;
}

/* ==========================
   TARJETA FLOTANTE
========================== */

.floating-card {
    position: absolute;
    left: 39%;
    top: 46%;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 165px;
    background: rgba(255,255,255,0.96);
    border: 1px solid #DDE6F0;
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: 0 14px 30px rgba(20, 35, 60, 0.12);
    transform: translate(-50%, -50%);
    transition: left .25s ease, top .25s ease, transform .25s ease;
    backdrop-filter: blur(4px);
}

    .floating-card::after {
        content: "";
        position: absolute;
        left: 24px;
        bottom: -8px;
        width: 14px;
        height: 14px;
        background: #FFFFFF;
        border-right: 1px solid #DDE6F0;
        border-bottom: 1px solid #DDE6F0;
        transform: rotate(45deg);
    }

.floating-dot,
.floating-icon {
    width: 10px;
    height: 10px;
    background: #2F76D2;
    box-shadow: 0 0 0 5px rgba(47, 118, 210, 0.12);
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 0;
}

.floating-card strong {
    display: block;
    color: #0B3F86;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.1;
}

.floating-card small {
    display: block;
    color: #6B7890;
    font-size: .83rem;
    margin-top: 3px;
}

/* ==========================
   CONTROLES DEL MAPA
========================== */

.map-controls {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 40;
}

    .map-controls button {
        width: 36px;
        height: 36px;
        border: 1px solid #E1EAF6;
        background: #FFFFFF;
        color: var(--azul-oscuro);
        border-radius: 12px;
        font-size: 18px;
        font-weight: 800;
        cursor: pointer;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.13);
        line-height: 1;
        transition: all .2s ease;
    }

        .map-controls button:hover {
            background: var(--azul-oscuro);
            color: #FFFFFF;
            border-color: var(--azul-oscuro);
        }

/* ==========================
   FOOTER DEL MAPA
========================== */

.map-footer {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 14px;
    color: #7B8798;
    font-size: .8rem;
}

/* ==========================
   RESPONSIVE
========================== */

@media (max-width: 992px) {
    .interactive-map-card {
        grid-template-columns: 1fr;
    }

    .region-panel {
        border-right: none;
        border-bottom: 1px solid #DCE6F3;
    }

    .map-background {
        height: 370px;
    }

    .map-canvas {
        width: 96%;
        max-width: 700px;
    }
}

@media (max-width: 768px) {
    .col-12 > .container.bg-white {
        padding: 0 14px 28px;
    }

    .suc-hero {
        padding: 38px 18px 34px;
        border-radius: 0 0 22px 22px;
    }

    .suc-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .map-visual {
        padding: 14px;
    }

    .map-background {
        height: 320px;
    }

    .floating-card {
        min-width: 145px;
        padding: 10px 12px;
    }

        .floating-card strong {
            font-size: .82rem;
        }

        .floating-card small {
            font-size: .72rem;
        }

    .map-controls {
        right: 12px;
        bottom: 12px;
    }

        .map-controls button {
            width: 32px;
            height: 32px;
            font-size: 16px;
        }
}

@media (max-width: 600px) {
    #map {
        height: 260px;
    }

    .region-panel {
        padding: 16px;
    }

    .region-item {
        padding: 11px;
    }

    .map-background {
        height: 285px;
    }

    .map-footer {
        display: none;
    }
}
