/**
 * SEAFORMEC — Componente Tabs
 * Versión: 3.2 — 2026-09-09
 * WordPress 7.1 — bloque nativo core/tabs
 *
 * Marcador de verificación:
 * SEAFORMEC_TABS_V3_2
 *
 * Variante base:
 * - Tabs + imagen
 *
 * Variante de servicio individual:
 * - .sf-tabs--text → texto introductorio + Tabs
 *
 * Clases:
 * - Sección Tabs      -> sf-tabs-section
 * - Variante texto    -> sf-tabs--text
 * - Contenedor Tabs   -> sf-tabs-container
 * - Layout            -> sf-tabs-layout
 * - Intro de texto    -> sf-tabs-intro
 * - Columna Tabs      -> sf-tabs-column
 * - Grupo Tabs        -> sf-tabs
 * - Columna imagen    -> sf-tabs-media
 *
 * Estructura variante texto:
 *
 * .sf-tabs-section.sf-tabs--text
 * ├── H2
 * └── .sf-tabs-container
 *     └── .sf-tabs-layout
 *         ├── .sf-tabs-intro
 *         └── .sf-tabs-column
 *             └── .sf-tabs
 */


/* ==========================================================
   1. SECCIÓN GENERAL — ancho wide real
   ========================================================== */

.sf-tabs-section {
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    width: min(1320px, calc(100vw - 64px)) !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    box-sizing: border-box;
}


/* ==========================================================
   2. CONTENEDOR INTERIOR
   ========================================================== */

.sf-tabs-container {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    box-sizing: border-box;
}


/* ==========================================================
   3. LAYOUT EXTERIOR — ESCRITORIO
   Tabs 60% + imagen 40%
   ========================================================== */

.sf-tabs-layout {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;

    width: 100% !important;
    max-width: none !important;

    gap: 48px !important;

    margin: 0 !important;
    padding: 0 !important;
}

.sf-tabs-column,
.sf-tabs-media {
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;
}

/* 60 / 40 incluyendo correctamente el gap */
.sf-tabs-column {
    flex: 3 1 0 !important;
}

.sf-tabs-media {
    position: relative !important;
    display: block !important;
    flex: 2 1 0 !important;

    overflow: hidden !important;
}


/* ==========================================================
   3.1. VARIANTE TEXTO LATERAL — ESCRITORIO
   Texto introductorio 40% + Tabs 60%
   ========================================================== */

.sf-tabs-section.sf-tabs--text {
    padding: 64px 0 !important;
}

.sf-tabs--text > h2 {
    margin: 0 0 32px !important;
}

.sf-tabs--text .sf-tabs-intro {
    flex: 2 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    box-sizing: border-box;
}

.sf-tabs--text .sf-tabs-column {
    flex: 3 1 0 !important;
}

.sf-tabs--text .sf-tabs-intro > :first-child {
    margin-top: 0 !important;
}

.sf-tabs--text .sf-tabs-intro > :last-child {
    margin-bottom: 0 !important;
}


/* ==========================================================
   4. IMAGEN
   ========================================================== */

.sf-tabs-media .wp-block-image {
    position: absolute !important;
    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
}

.sf-tabs-media .wp-block-image img,
.sf-tabs-media img {
    display: block;

    width: 100% !important;
    height: 100% !important;

    
    object-fit: cover;
    object-position: center;
}


/* ==========================================================
   5. WRAPPER PERSONALIZADO
   ========================================================== */

.sf-tabs {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;
}


/* ==========================================================
   6. BLOQUE NATIVO core/tabs — ESCRITORIO
   Pestañas a la izquierda + panel a la derecha
   ========================================================== */

.sf-tabs .wp-block-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;

    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 320px !important;

    gap: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 1px solid rgba(0, 0, 0, 0.12) !important;

    box-sizing: border-box;
}


/* ==========================================================
   7. LISTA DE PESTAÑAS — VERTICAL EN ESCRITORIO
   ========================================================== */

.sf-tabs .wp-block-tab-list {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;

        align-items: stretch !important;
    justify-content: flex-start !important;

    flex: 0 0 190px !important;
    width: 190px !important;
    min-width: 190px !important;

    gap: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    background: var(--wp--preset--color--light-gray, #ECECED) !important;

    border: 0 !important;

    box-sizing: border-box;
}

.sf-tabs .wp-block-tab-list > button {
    position: relative;

    display: flex !important;
    align-items: center !important;

    flex: 1 1 0 !important;

    width: 100% !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 22px 24px 22px 44px !important;

    border: 0 !important;
    border-left: 4px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;

    color: #000 !important;

    font: inherit !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;

    text-align: left !important;

    cursor: pointer;
}

.sf-tabs .wp-block-tab-list > button[aria-selected="true"] {
    border-left-color:
        var(--wp--preset--color--seaformec-yellow, #F0AB00) !important;

    background: rgba(255, 255, 255, 0.62) !important;

    font-weight: 700 !important;
}

@media (hover: hover) and (pointer: fine) {
    .sf-tabs .wp-block-tab-list > button:hover {
        background: rgba(255, 255, 255, 0.40) !important;
    }
}

.sf-tabs .wp-block-tab-list > button:focus-visible {
    outline: 2px solid
        var(--wp--preset--color--seaformec-yellow, #F0AB00);

    outline-offset: -3px;
}


/* ==========================================================
   8. PANELES — ESCRITORIO
   ========================================================== */

.sf-tabs .wp-block-tab-panels {
    display: flex !important;
    align-items: center !important;

    flex: 1 1 auto !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 42px 36px !important;

    border: 0 !important;
    border-left: 1px solid rgba(0, 0, 0, 0.10) !important;

    background: #fff !important;

    box-sizing: border-box;
}

.sf-tabs .wp-block-tab-panel {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;
}

.sf-tabs .wp-block-tab-panel > :first-child {
    margin-top: 0 !important;
}

.sf-tabs .wp-block-tab-panel > :last-child {
    margin-bottom: 0 !important;
}



/* ==========================================================
   9. TABLET Y PORTÁTIL ESTRECHO
   Igual que móvil: Tabs arriba + imagen debajo
   ========================================================== */

@media (max-width: 1100px) {

    .sf-tabs-section {
        width: calc(100vw - 48px) !important;
    }

    .sf-tabs-layout {
        flex-direction: column !important;
        flex-wrap: nowrap !important;

        gap: 32px !important;
    }

    .sf-tabs-column,
    .sf-tabs-media {
        flex: 0 0 auto !important;

        width: 100% !important;
        max-width: none !important;
    }

    .sf-tabs-column {
        order: 1 !important;
    }

    .sf-tabs-media {
        position: static !important;
        display: block !important;
        overflow: visible !important;

        order: 2 !important;
    }

    .sf-tabs-media .wp-block-image {
        position: static !important;
        inset: auto !important;
    }

    /* Tabs nativo en una sola columna */
    .sf-tabs .wp-block-tabs {
        display: block !important;
        min-height: 0 !important;
    }

    /* Navegación horizontal */
    .sf-tabs .wp-block-tab-list {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;

        width: 100% !important;
        min-width: 0 !important;

        
        padding: 0 !important;

        background:
            var(--wp--preset--color--light-gray, #ECECED) !important;

        border-bottom:
            1px solid rgba(0, 0, 0, 0.10) !important;
    }

    .sf-tabs .wp-block-tab-list > button {
        justify-content: center !important;

        width: 100% !important;
        min-height: 58px !important;

        padding: 14px 8px !important;

        border-left: 0 !important;
        border-bottom: 3px solid transparent !important;

        font-size: 15px !important;

        text-align: center !important;
    }

    .sf-tabs .wp-block-tab-list > button[aria-selected="true"] {
        border-bottom-color:
            var(--wp--preset--color--seaformec-yellow, #F0AB00) !important;

        background: rgba(255, 255, 255, 0.62) !important;
    }

    /* Panel debajo de la navegación */
    .sf-tabs .wp-block-tab-panels {
        display: block !important;

        width: 100% !important;
        min-width: 0 !important;

        padding: 32px 28px !important;

        border-left: 0 !important;
    }

    /* Imagen debajo */
    .sf-tabs-media .wp-block-image,
    .sf-tabs-media .wp-block-image img,
    .sf-tabs-media img {
        height: auto !important;
    }

    .sf-tabs-media img {
        aspect-ratio: 16 / 9 !important;
        object-fit: cover !important;
    }

    .sf-tabs--text > h2 {
        margin-bottom: 28px !important;
    }

    .sf-tabs--text .sf-tabs-intro,
    .sf-tabs--text .sf-tabs-column {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: none !important;
    }

    .sf-tabs--text .sf-tabs-intro {
        order: 1 !important;
    }

    .sf-tabs--text .sf-tabs-column {
        order: 2 !important;
    }
}



/* ==========================================================
   10. MÓVIL
   ========================================================== */

@media (max-width: 600px) {

    .sf-tabs-section {
        width: calc(100vw - 32px) !important;
    }

    .sf-tabs-layout {
        gap: 24px !important;
    }

    .sf-tabs .wp-block-tab-list > button {
        min-height: 54px !important;

        padding: 12px 6px !important;

        font-size: 14px !important;
    }

    .sf-tabs .wp-block-tab-panels {
        padding: 28px 24px !important;
    }

    .sf-tabs-media img {
        aspect-ratio: 16 / 10 !important;
    }

    .sf-tabs--text > h2 {
        margin-bottom: 24px !important;
    }

    .sf-tabs-section.sf-tabs--text {
        padding-top: 32px !important;
        padding-bottom: 24px !important;
}
}


/* ==========================================================
   11. MÓVIL PEQUEÑO
   ========================================================== */

@media (max-width: 380px) {

    .sf-tabs-section {
        width: calc(100vw - 24px) !important;
    }

    .sf-tabs .wp-block-tab-list > button {
        padding-inline: 4px !important;
        font-size: 13px !important;
    }

    .sf-tabs .wp-block-tab-panels {
        padding: 24px 20px !important;
    }
}


