/* SUCURSALES — estilos del módulo (CSS plano; carga condicional vía enqueue.php)
 * Bootstrap 5. Colores: --bs-primary #132b51, --bs-warning #ffc107.
 * =========================================================================== */

/* ---------- Índice: horario ---------- */
.sucursal-hours {
    color: var(--bs-primary);
    font-size: 1rem;
    line-height: 1.6;
}

/* ---------- Índice: leyenda de servicios ---------- */
.sucursal-legend {
    margin-bottom: 2rem;
}
/* Grid de 5 columnas: 9-10 servicios entran en 2 filas a todo el ancho. */
.sucursal-legend__list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.sucursal-legend__item {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: var(--bs-primary);
    font-size: .9rem;
    font-weight: 500;
}
/* Badge circular del ícono de servicio (compartido leyenda / tarjetas / single) */
.sucursal-icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #f1f1f1;
    border-radius: 50%;
    flex: 0 0 auto;
}
.sucursal-icon-circle img {
    width: 58%;
    height: 58%;
    object-fit: contain;
}
.sucursal-icon-circle--sm {
    width: 40px;
    height: 40px;
}

/* ---------- Índice: tarjeta de sucursal ---------- */
.sucursal-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f2f2f4;
    border-radius: 16px;
    padding: 12px;
    transition: box-shadow .2s ease, transform .2s ease;
}
.sucursal-card:hover {
    box-shadow: 0 .5rem 1.25rem rgba(19, 43, 81, .12);
    transform: translateY(-2px);
}
.sucursal-card__img {
    display: block;
    height: 190px;
    border-radius: 10px;
    background-color: var(--bs-primary);
    background-size: cover;
    background-position: center;
}
.sucursal-card__body {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1rem .4rem .25rem;
    flex: 1 1 auto;
}
.sucursal-card__title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
}
.sucursal-card__title a {
    color: var(--bs-primary);
    text-decoration: none;
}
.sucursal-card__title a:hover {
    color: var(--bs-warning);
}
.sucursal-card__address {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    min-height: 2.7rem; /* reserva ~2 líneas para alinear los iconos entre tarjetas */
    font-size: .95rem;
    line-height: 1.4;
    color: var(--bs-primary);
}
.sucursal-card__services {
    margin-top: .25rem;
}
.sucursal-card__services-label {
    display: block;
    font-size: .95rem;
    color: var(--bs-primary);
    margin-bottom: .5rem;
}
.sucursal-card__icons {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.sucursal-card__icon {
    display: inline-flex;
}
.sucursal-card__icons .sucursal-service-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Botones de teléfono */
.sucursal-card__phones {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: auto;
    padding-top: 20px;
}
.sucursal-card__phone {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .7rem .6rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    border: 2px solid transparent;
    white-space: nowrap;
    transition: opacity .2s ease, background-color .2s ease, color .2s ease;
}
.sucursal-card__phone:hover {
    opacity: .9;
}
.sucursal-card__phone--primary {
    background: var(--bs-warning);
    color: var(--bs-primary);
}
.sucursal-card__phone--outline {
    background: #fff;
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Saber más */
.sucursal-card__more {
    display: block;
    margin-top: .9rem;
    padding: .8rem 1rem;
    border-radius: 10px;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background-color .2s ease;
}
.sucursal-card__more:hover {
    background: #0e2240;
    color: #fff;
}

/* NOTA: la banda CTA de índice y single ahora usa el partial reutilizable
 * partials/general/cta.php (clases .home-cta*, ya estilizadas en el bundle global) y es
 * autoadministrable desde la página "Sucursales" (grupo ACF "Sucursales - Barra CTA"). */

/* ===========================================================================
 * SINGLE de sucursal
 * =========================================================================== */

/* Título de sección con subrayado amarillo (Acenor {sucursal}, Servicios, etc.) */
.sucursal-section {
    margin-top: 3.5rem;
}
.sucursal-section__title {
    position: relative;
    margin: 0 0 1.75rem;
    padding-bottom: .6rem;
    color: var(--bs-primary);
    font-size: 1.35rem;
    font-weight: 700;
}
.sucursal-section__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 46px;
    height: 3px;
    background: var(--bs-warning);
    border-radius: 2px;
}

/* ---------- Single: cabecera (mapa + jefe + contacto) ---------- */
.sucursal-single__header {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 2.5rem;
    align-items: stretch;
}
.sucursal-single__map {
    border-radius: 14px;
    overflow: hidden;
    height: 300px;
    background: #eef0f3;
}
.sucursal-single__map iframe,
.sucursal-single__map > * {
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
}
.sucursal-single__info {
    display: flex;
    flex-direction: column;
    padding-top: .25rem;
}
.sucursal-info-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}
.sucursal-info-list li {
    display: flex;
    gap: .8rem;
    align-items: flex-start;
    color: var(--bs-primary);
    font-size: 1.08rem;
    line-height: 1.5;
    margin-bottom: .9rem;
}
.sucursal-info-list li i {
    color: var(--bs-warning);
    margin-top: .25rem;
    flex: 0 0 20px;
    font-size: 1.1rem;
    text-align: center;
}
.sucursal-info-list a {
    color: inherit;
    text-decoration: none;
}
.sucursal-info-list a:hover {
    color: var(--bs-warning);
}
.sucursal-single__phones {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
    max-width: 340px;
    margin-top: auto;
}
.sucursal-single__phones .sucursal-card__phone {
    flex: 0 0 auto;
    width: 100%;
}

/* ---------- Single: servicios de la tienda ---------- */
.sucursal-service-card {
    display: flex;
    height: 100%;
    background: #f5f5f7;
    border-radius: 14px;
    overflow: hidden;
}
.sucursal-service-card__img {
    flex: 0 0 38%;
    min-height: 100%;
    background-color: var(--bs-primary);
    background-size: cover;
    background-position: center;
}
.sucursal-service-card__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.1rem 1.1rem;
    min-width: 0;
}
.sucursal-service-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}
.sucursal-service-card__title {
    margin: 0;
    color: var(--bs-primary);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}
.sucursal-service-card__icon {
    flex: 0 0 auto;
}
.sucursal-service-card__icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}
.sucursal-service-card__desc {
    margin: .5rem 0 0;
    color: #5a6474;
    font-size: .85rem;
    line-height: 1.4;
    flex: 1 1 auto;
}
.sucursal-service-card__more {
    align-self: flex-start;
    margin-top: 1rem;
    padding: .45rem 1.2rem;
    border-radius: 8px;
    background: var(--bs-warning);
    color: var(--bs-primary);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .2s ease;
}
.sucursal-service-card__more:hover {
    opacity: .9;
    color: var(--bs-primary);
}

/* ---------- Single: descuentos de tienda ---------- */
.sucursal-discount {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    min-height: 128px;
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bs-primary);
    background-size: cover;
    background-position: center;
    color: #fff;
}
.sucursal-discount::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(19,43,81,.35) 0%, rgba(19,43,81,.82) 100%);
}
.sucursal-discount__title,
.sucursal-discount__condition {
    position: relative;
    margin: 0;
}
.sucursal-discount__title {
    font-size: 1.05rem;
    font-weight: 700;
}
.sucursal-discount__condition {
    margin-top: .25rem;
    font-size: .8rem;
    opacity: .9;
}

/* ---------- Single: proyectos de clientes ---------- */
.sucursal-project {
    position: relative;
    display: block;
    height: 100%;
    min-height: 210px;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bs-primary);
    background-size: cover;
    background-position: center;
    border: 3px solid transparent;
    transition: border-color .2s ease;
}
.sucursal-project__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem;
    background: rgba(19, 43, 81, .78);
    color: #fff;
    opacity: 0;
    transition: opacity .2s ease;
}
.sucursal-project__title {
    margin: 0;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.4;
}
.sucursal-project:hover {
    border-color: var(--bs-warning);
}
.sucursal-project:hover .sucursal-project__overlay {
    opacity: 1;
}

/* ---------- Single: productos destacados ---------- */
.sucursal-featured .carousel-indicators {
    position: static;
    margin: 1.25rem 0 0;
}
.sucursal-featured .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background-color: #cdd2db;
    opacity: 1;
}
.sucursal-featured .carousel-indicators .active {
    background-color: var(--bs-warning);
}

/* ===========================================================================
 * Responsive
 * =========================================================================== */

/* Tablet hacia abajo */
@media (max-width: 991.98px) {
    .sucursal-icon-circle {
        width: 56px;
        height: 56px;
    }
    .sucursal-legend__list {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

/* Móvil */
@media (max-width: 767.98px) {
    .sucursal-hours {
        font-size: .9rem;
    }

    /* Leyenda: 2 columnas en móvil */
    .sucursal-legend__list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem .75rem;
    }
    .sucursal-legend__item {
        font-size: .8rem;
    }
    .sucursal-icon-circle {
        width: 48px;
        height: 48px;
    }

    /* CTA: botones a ancho completo y centrados (como la CTA de la home) */
    .sucursal-cta .home-cta__actions {
        justify-content: stretch;
        width: 100%;
    }
    .sucursal-cta__btn {
        flex: 1 1 100%;
        justify-content: center;
        white-space: normal;
    }
}

/* Single: cabecera apilada en tablet/móvil */
@media (max-width: 991.98px) {
    .sucursal-single__header {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
    .sucursal-single__info {
        max-width: 560px;
    }
}

/* Móvil chico: la grilla ya es 1 columna (row-cols-1); ajustes finos de tarjeta */
@media (max-width: 575.98px) {
    .sucursal-card__img {
        height: 200px;
    }
    .sucursal-card__phone {
        flex: 1 1 auto;
        text-align: center;
    }
    /* Single: la tarjeta de servicio pasa a vertical */
    .sucursal-service-card {
        flex-direction: column;
    }
    .sucursal-service-card__img {
        flex: 0 0 auto;
        height: 150px;
    }
}
