/**
 * ============================================================================
 * Cualinet Gravity Fields — Campo "Tarjeta de oferta" (cnt_offer_card)
 * ============================================================================
 *
 * Card configurable con switch on/off, imagen opcional a la derecha,
 * encabezado, lista de checks, footnote y bloque de precio (slider o input).
 *
 * Estados visuales:
 *   - .gf-oc-wrapper                 → card "apagada" (gris, contenido suave)
 *   - .gf-oc-wrapper.gf-oc-wrapper--enabled  → card "encendida" (interactiva)
 *
 * Variables CSS para personalización.
 * ============================================================================
 */

.gf-oc-wrapper {
    /* Variables alineadas con .grav-emulate.box-with-toogle de preweb.racc.es. */
    --gf-oc-bg:               #fefefe;
    --gf-oc-bg-soft:          #f5f6f7;
    --gf-oc-border:           #b9c0c7;            /* gris claro del card */
    --gf-oc-border-strong:    #1a1a1a;            /* negro de inputs internos */
    --gf-oc-text:             #1a1a1a;
    --gf-oc-text-muted:       #777d83;
    --gf-oc-primary:          #f5e642;            /* amarillo RACC */
    --gf-oc-primary-hover:    #e8d92f;
    --gf-oc-check:            #1a7f1a;
    --gf-oc-radius:           4px;                /* radio del card */
    --gf-oc-radius-sm:        4px;
    --gf-oc-tag-bg:           #ffe98a;            /* amarillo pastel */
    --gf-oc-tag-text:         #665300;            /* marrón oscuro */
    --gf-oc-shadow:           none;
    --gf-oc-transition:       0.18s ease;
    --gf-oc-font-size:        inherit;            /* hereda Inter 18px del tema */

    position: relative;
    display: flex;
    flex-direction: column;
    gap: 27px;
    width: 100%;
    padding: 27px;                 /* alineado con .grav-emulate.box-with-toogle de preweb */
    /* Container query context: la decisión de apilar el header (tag/switch)
       depende del ancho REAL de la card, no del viewport. Así un viewport
       móvil-ancho (~600px) con la card a 500px mantiene tag+switch en la
       misma fila (como Figma), pero un sidebar estrecho a 280px colapsa. */
    container-type: inline-size;
    container-name: gf-oc-card;
    background: var(--gf-oc-bg);
    border: 1px solid var(--gf-oc-border);
    border-radius: var(--gf-oc-radius);
    box-shadow: var(--gf-oc-shadow);
    box-sizing: border-box;
    /* Tipografía base alineada con el form de preweb.racc.es */
    font-family: inherit;          /* hereda Inter del tema */
    font-size: 18px;
    line-height: 1.5;
    color: var(--gf-oc-text);
    transition: border-color var(--gf-oc-transition), opacity var(--gf-oc-transition);
}

/* En el preview del editor admin GF inyecta reset CSS sobre .ginput_container
   (border:0, background:transparent) — recuperamos border y background con
   doble especificidad. NO forzamos padding con !important para que el tema/
   sitio pueda override si quiere (R6: conformidad con codebase). */
.ginput_container.gf-oc-wrapper {
    background: var(--gf-oc-bg);
    border: 1px solid var(--gf-oc-border);
    border-radius: var(--gf-oc-radius);
    position: relative;
}

/* Estado deshabilitado: SOLO se atenúa lo dinámico (price = slider/input).
   El contenido estático (título, subtítulo, checks, footnote, imagen) se ve
   normal aunque el switch esté off — solo está "informando" al usuario
   sin que pueda interactuar con el control numérico. */

.gf-oc-wrapper:not(.gf-oc-wrapper--enabled) .gf-oc-price {
    opacity: 0.55;
    pointer-events: none;
}

/* Por accesibilidad: handle del slider y input numérico no focuseables con Tab. */
.gf-oc-wrapper:not(.gf-oc-wrapper--enabled) .gf-oc-slider-handle,
.gf-oc-wrapper:not(.gf-oc-wrapper--enabled) .gf-oc-number {
    pointer-events: none;
}

/* El bloque de precio (slider/input) solo es visible cuando la card está ON.
   Si el usuario aún no ha activado la oferta, no le pedimos importe. */
.gf-oc-wrapper:not(.gf-oc-wrapper--enabled) .gf-oc-price {
    display: none;
}

/* ─── TAG DE OFERTA ───────────────────────────────────────────────────── */

/* Tag amarillo "OFERTA EXCLUSIVA". El emoji va DENTRO del rectángulo, separado
   del texto por un gap de 8px (alineado con Figma). */
.gf-oc-wrapper .gf-oc-tag,
.gf-oc-wrapper span.gf-oc-tag {
    /* !important defensivo — algún CSS del tema/GF estaba forzando display:block
       lo que causaba que el emoji y el texto cayeran en líneas distintas.
       Padding y radius alineados con el render de preweb.racc.es (rectángulo más
       generoso y bordes ligeramente redondeados). */
    display: inline-flex !important;
    align-self: flex-start;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--gf-oc-tag-bg);
    color: var(--gf-oc-tag-text);
    font-size: 15px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0.02em;
    border-radius: 4px;
    white-space: nowrap !important;
}

.gf-oc-wrapper .gf-oc-tag-icon {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    font-size: 18px;
    line-height: 1;
    align-items: center;
}

.gf-oc-wrapper .gf-oc-tag-text {
    flex-shrink: 0 !important;
    display: inline-block !important;
    white-space: nowrap !important;
}

/* ─── SWITCH (on/off) ─────────────────────────────────────────────────── */
/* Reset agresivo: muchos temas/admins (WordPress) estilan <button> con bg azul
   por defecto. Forzamos appearance:none y fondo transparente. */

.gf-oc-wrapper .gf-oc-switch,
.gf-oc-wrapper button.gf-oc-switch {
    /* Reset agresivo con !important: el admin de WordPress estila <button> con
       bg azul de admin (#204ce5). Hay que ganar de todas formas. Ahora el switch
       vive DENTRO del flex header — no necesita absolute positioning. */
    position: relative !important;
    display: inline-flex !important;
    align-items: center;
    flex-shrink: 0;
    width: 52px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none !important;
    appearance: none !important;
    overflow: visible;
}

.gf-oc-wrapper .gf-oc-switch:hover,
.gf-oc-wrapper .gf-oc-switch:focus,
.gf-oc-wrapper .gf-oc-switch:active {
    background: transparent;
    box-shadow: none;
    outline: none;
}

.gf-oc-wrapper .gf-oc-switch-track {
    position: absolute !important;
    inset: 0;
    width: auto;
    height: auto;
    background: #c8c8cc !important;
    border-radius: 999px !important;
    transition: background var(--gf-oc-transition);
}

.gf-oc-wrapper .gf-oc-switch-thumb {
    position: relative !important;
    width: 22px !important;
    height: 22px !important;
    margin-left: 3px;
    background: #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform var(--gf-oc-transition);
    z-index: 1;
}

/* Estado ON: amarillo RACC. Necesita !important porque la regla base del track
   también lo usa (reset agresivo vs admin de WP que estila <button>). */
.gf-oc-wrapper.gf-oc-wrapper--enabled .gf-oc-switch-track {
    background: #e8bc00 !important;   /* amarillo RACC corporativo */
}

.gf-oc-wrapper.gf-oc-wrapper--enabled .gf-oc-switch-thumb {
    transform: translateX(24px) !important;
}

.gf-oc-switch:focus-visible .gf-oc-switch-track {
    outline: 2px solid var(--gf-oc-border-strong);
    outline-offset: 2px;
}

/* Si hay tag de oferta, el switch baja un pelín para no chocar */
.gf-oc-wrapper:has(.gf-oc-tag) .gf-oc-switch {
    top: 18px;
}

/* ─── BODY (layout) ───────────────────────────────────────────────────── */
/* Layout single (sin imagen): el body es flex column con el contenido. */
/* Layout two-col: grid 2 columnas para imagen + col-main. El bloque de
   precio (slider/number) está FUERA del body, debajo, full-width. */

.gf-oc-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: opacity var(--gf-oc-transition);
}

.gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-body {
    display: grid;
    grid-template-columns: minmax(180px, 387px) 1fr;
    gap: 16px;
    align-items: stretch;
}

.gf-oc-wrapper .gf-oc-col--main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.gf-oc-wrapper .gf-oc-col--aside {
    /* La altura del col-aside la dicta el col-main (texto) gracias a align-items:stretch
       del grid. Para que la imagen NO arrastre la altura del row a su tamaño natural,
       la sacamos del flujo con position:absolute y la dejamos llenar todo el col. */
    position: relative;
    align-self: stretch;
    min-width: 0;
    min-height: 220px;     /* mínimo razonable si el texto es muy corto */
    overflow: hidden;
    border-radius: var(--gf-oc-radius-sm);
    background: var(--gf-oc-bg-soft);
}

/* ─── HEADER (título + subtítulo + switch) ────────────────────────────── */
/* El header es flex row: a la izquierda title-text (tag + título + subtítulo),
   a la derecha el switch. Alineado con el diseño del Figma:
   - Título: 20px / 600 / line-height 26px
   - Subtítulo: 20px / 400 / line-height 1.2
   - Switch: 52×32, alineado verticalmente con el inicio del texto. */

.gf-oc-wrapper .gf-oc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
}

.gf-oc-wrapper .gf-oc-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
}

/* Cuando hay tag de oferta, queremos un respiro entre el tag y el título
   un poco menor que el resto: el tag ya aporta su propio padding interno
   (12px arriba + 12px abajo), así que un gap pequeño es suficiente. */
.gf-oc-wrapper .gf-oc-tag + .gf-oc-title,
.gf-oc-wrapper .gf-oc-tag + .gf-oc-subtitle {
    margin-top: 2px;
}

.gf-oc-wrapper .gf-oc-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 26px;
    color: var(--gf-oc-text);
}

.gf-oc-wrapper .gf-oc-subtitle {
    margin: 0;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--gf-oc-text);
}

/* ─── DIVIDER ─────────────────────────────────────────────────────────── */

.gf-oc-divider {
    width: 100%;
    height: 0;
    margin: 4px 0;
    border: 0;
    border-top: 1px solid var(--gf-oc-border);
}

/* ─── CHECKS ──────────────────────────────────────────────────────────── */

.gf-oc-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Variante: lista debajo del slider, con un poco más de margen superior */
.gf-oc-wrapper .gf-oc-checks--after {
    margin-top: 18px;
}

.gf-oc-wrapper .gf-oc-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--gf-oc-text);
}

.gf-oc-wrapper .gf-oc-check-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gf-oc-check);
    font-weight: 700;
    margin-top: 4px;     /* alinea con la primera línea del texto a 18px */
}

.gf-oc-check-text {
    flex: 1 1 auto;
}

/* ─── FOOTNOTE ────────────────────────────────────────────────────────── */

.gf-oc-wrapper .gf-oc-footnote {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--gf-oc-text-muted);
}

/* ─── IMAGEN ──────────────────────────────────────────────────────────── */

/* Imagen dentro del col-aside two-col: position absolute para que llene el
   contenedor sin arrastrar la altura del grid. */
.gf-oc-wrapper .gf-oc-col--aside .gf-oc-image {
    position: absolute;
    inset: 0;
    margin: 0;
    overflow: hidden;
}

.gf-oc-wrapper .gf-oc-col--aside .gf-oc-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Imagen del layout single (full width, no two-col): tamaño natural acotado. */
.gf-oc-wrapper .gf-oc-image--full {
    margin: 0;
    border-radius: var(--gf-oc-radius-sm);
    overflow: hidden;
    background: var(--gf-oc-bg-soft);
}

.gf-oc-wrapper .gf-oc-image--full img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
}

.gf-oc-wrapper .gf-oc-image--full {
    width: 100%;
    height: auto;                /* en layout single, mostrar tamaño natural pero acotado */
    min-height: 0;
}

.gf-oc-wrapper .gf-oc-image--full img {
    height: auto;
    max-height: 300px;
}

/* ─── BLOQUE DE PRECIO ────────────────────────────────────────────────── */

.gf-oc-wrapper .gf-oc-price {
    display: flex;
    flex-direction: column;
    gap: 13px;       /* alineado con Figma (DataRange gap-[13px]) */
    width: 100%;
}

.gf-oc-wrapper .gf-oc-price-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--gf-oc-text);
}

/* Slider custom — clon visual de noUiSlider (usado por Gravity Slider Fields).
   Estructura: .gf-oc-slider-display contiene .gf-oc-slider-connect (track relleno
   amarillo) y .gf-oc-slider-handle (botón redondo). El JS posiciona ambos según el
   valor. Mantiene accesibilidad con role="slider" y aria-valuenow. */

.gf-oc-slider-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 16px;       /* hueco arriba para el tooltip cuando aparece */
}

.gf-oc-slider-display {
    position: relative;
    width: 100%;
    height: 6px;
    background: #fafafa;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px 0 #f0f0f0, 0 3px 6px -5px #bbbbbb;
    cursor: pointer;
    touch-action: none;
}

.gf-oc-slider-connect {
    position: absolute;
    top: 0;
    left: 0;
    height: 6px;
    width: 0;                /* JS actualiza */
    background: #ffcf00;
    border-radius: 4px;
    pointer-events: none;
}

.gf-oc-slider-handle {
    position: absolute;
    top: 50%;
    left: 0;                 /* JS actualiza */
    width: 20px;
    height: 20px;
    background: #ffcf00;
    border: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    cursor: grab;
    touch-action: none;
    transition: box-shadow 0.12s ease;
}

.gf-oc-slider-handle:focus-visible {
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(255, 207, 0, 0.3);
}

.gf-oc-slider-handle.is-dragging {
    cursor: grabbing;
}

/* Tooltip arriba del handle (igual a .noUi-tooltip de noUiSlider) */
.gf-oc-slider-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #ffffff;
    border: 1px solid #ffcf00;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1.2;
    color: #000000;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.gf-oc-slider-tooltip::after {
    /* Pequeña flecha apuntando al handle */
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-right: 1px solid #ffcf00;
    border-bottom: 1px solid #ffcf00;
    transform: translate(-50%, -50%) rotate(45deg);
}

.gf-oc-slider-handle:focus-visible .gf-oc-slider-tooltip,
.gf-oc-slider-handle.is-dragging .gf-oc-slider-tooltip,
.gf-oc-slider-display:hover .gf-oc-slider-tooltip {
    opacity: 1;
}

/* 3 labels al pie del slider: min izquierda, current en pill al centro, max derecha.
   Alineado con el "DataRange" del Figma. */
.gf-oc-slider-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--gf-oc-text);
    gap: 8px;
}

.gf-oc-slider-min,
.gf-oc-slider-max {
    color: var(--gf-oc-text);
    font-weight: 400;
    padding: 4px;
    text-align: center;
}

.gf-oc-slider-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 4px 12px;
    border: 1px solid #d7dbdf;
    background: var(--gf-oc-bg);
    color: var(--gf-oc-text);
    font-weight: 400;
    text-align: center;
    border-radius: 2px;
    gap: 4px;
}

/* Input editable que sustituye al texto plano de la pill central del slider.
   Reset agresivo para que NO herede del .ginput_container ni del tema: ni borde,
   ni fondo, ni padding ajeno; vive dentro del wrapper .gf-oc-slider-current
   que ya aporta esos elementos.

   width en px (no ch) — la unidad ch depende de la métrica de "0" de la fuente
   y resulta inconsistente; 80px deja espacio cómodo para 4-5 dígitos + cursor
   en cualquier fuente sans-serif razonable. */
.gf-oc-wrapper .gf-oc-slider-current-input,
.gf-oc-wrapper input[type="number"].gf-oc-slider-current-input {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit;
    font: inherit;
    font-weight: 500;
    text-align: center;
    -moz-appearance: textfield;
    outline: none;
}
.gf-oc-wrapper .gf-oc-slider-current-input::-webkit-outer-spin-button,
.gf-oc-wrapper .gf-oc-slider-current-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.gf-oc-wrapper .gf-oc-slider-current-input:focus-visible {
    outline: none;
}
.gf-oc-wrapper .gf-oc-slider-current:focus-within {
    border-color: var(--gf-oc-border-strong, #1d1d1d);
    box-shadow: 0 0 0 2px rgba(29, 35, 39, 0.12);
}
.gf-oc-slider-current-suffix {
    color: var(--gf-oc-text-muted, #5a5d63);
    font-size: 13px;
    pointer-events: none;
}

/* Card off: input bloqueado de la pill central. */
.gf-oc-wrapper:not(.gf-oc-wrapper--enabled) .gf-oc-slider-current-input {
    pointer-events: none;
    color: var(--gf-oc-text-muted, #9da1a8);
}

/* Input numérico */

.gf-oc-number-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gf-oc-number {
    width: 100%;
    max-width: 280px;
    padding: 12px 16px;
    border: 1px solid var(--gf-oc-border-strong);
    border-radius: var(--gf-oc-radius-sm);
    font-size: inherit;
    font-family: inherit;
    background: #ffffff;
    color: var(--gf-oc-text);
    box-sizing: border-box;
}

.gf-oc-number:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(29, 35, 39, 0.12);
}

.gf-oc-number-suffix {
    color: var(--gf-oc-text-muted);
    font-size: 14px;
}

/* Ajustes generales de mobile (padding/gap del wrapper). */
@media (max-width: 600px) {
    .gf-oc-wrapper {
        padding: 24px;
        gap: 16px;
    }
    .gf-oc-wrapper .gf-oc-header {
        flex-wrap: nowrap;
    }
    .gf-oc-wrapper .gf-oc-header-text {
        min-width: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   FLAT-STACK del layout two-col — basado en ancho de la card.

   Cuando la card mide < 720px, el grid de dos columnas (imagen | texto)
   aplasta el texto a ~250-280px y palabras como "imprevistos" se parten en
   varias líneas. Por debajo de ese umbral mejor aplanamos a vertical con
   este orden visual:

       1. Header (tag + título + subtítulo + switch)
       2. Imagen (con aspect-ratio 16/10)
       3. Divider
       4. Checks
       5. Footnote

   Conseguimos ese orden con `display: contents` en las dos columnas (las
   "desaparecen" del layout pero conservan sus hijos) + flex column en el
   body + `order` en los hijos directos.

   El threshold 720px del container query equivale aproximadamente a un
   viewport de ~750px con paddings normales del tema.
   ═════════════════════════════════════════════════════════════════ */
@container gf-oc-card (max-width: 720px) {
    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-body {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-col--aside,
    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-col--main {
        display: contents;
    }

    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-header   { order: 1; }
    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-image    { order: 2; }
    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-divider  { order: 3; }
    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-checks   { order: 4; }
    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-footnote { order: 5; }

    /* La imagen pasa de col-aside absolute → flujo normal con aspect-ratio. */
    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-col--aside {
        position: static;
        overflow: visible;
        background: transparent;
        border-radius: 0;
        min-height: 0;
    }
    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-col--aside .gf-oc-image {
        position: static;
        inset: auto;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 10;
        width: 100%;
        border-radius: var(--gf-oc-radius-sm);
        overflow: hidden;
        background: var(--gf-oc-bg-soft);
    }
    .gf-oc-wrapper--layout-two-col.gf-oc-wrapper--has-image .gf-oc-col--aside .gf-oc-image img {
        height: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   STACK INTELIGENTE DEL HEADER — basado en ancho de la card, no del viewport.

   Cuando la card es lo bastante ancha (>= 420px), tag y switch conviven en
   la misma fila (layout original tipo Figma / preweb.racc.es):

       ┌───────────────────────────────────┐
       │  🎁 OFERTA EXCLUSIVA    [switch] │
       │  ¿Quieres un 5% de descuento...?  │
       └───────────────────────────────────┘

   Cuando la card no llega (sidebar estrecho, mobile <= 360px viewport, o
   anidada en una columna), el header se reorganiza en 3 filas para evitar
   que el switch pise el tag:

       ┌───────────────────────────┐
       │              [switch]    │
       │  🎁 OFERTA EXCLUSIVA      │
       │  ¿Quieres un 5% de        │
       │  descuento adicional...?  │
       └───────────────────────────┘
   ═════════════════════════════════════════════════════════════════ */
@container gf-oc-card (max-width: 420px) {
    .gf-oc-wrapper .gf-oc-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .gf-oc-wrapper .gf-oc-header-text {
        order: 2;
        min-width: 0;
    }
    .gf-oc-wrapper .gf-oc-switch {
        order: 1;
        align-self: flex-end;
        top: 0 !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   DEFENSA contra gf_stylespro en mobile (≤ 641px).

   Styles Pro Add-On de Gravity Forms inyecta esta regla:
       .gf_stylespro .ginput_container span:not(.ginput_price):not(.gfsp_icon):not(.ginput_card_security_code_icon) {
           margin-bottom: 8px;
           display: block;
       }

   Aplica a TODOS los <span> dentro de .ginput_container — lo que rompe
   nuestro tag (padding fantasma debajo), el switch (thumb desplazado por
   margin), las labels del slider (cada label en una línea, sin alineación
   horizontal) y los suffixes (cae a línea nueva separado del número).

   Solución: re-establecer el display correcto y anular el margin-bottom
   en todos los spans descendientes de .gf-oc-wrapper. !important porque
   la regla origen también usa la cadena .gf_stylespro .ginput_container
   y necesitamos ganar de forma fiable sin replicar su contexto.
   ═════════════════════════════════════════════════════════════════ */
@media only screen and (max-width: 641px) {
    .gf-oc-wrapper span {
        margin-bottom: 0 !important;
    }

    /* Spans inline (labels, suffixes, texto de los checks). */
    .gf-oc-wrapper .gf-oc-slider-min,
    .gf-oc-wrapper .gf-oc-slider-max,
    .gf-oc-wrapper .gf-oc-slider-current-suffix,
    .gf-oc-wrapper .gf-oc-number-suffix,
    .gf-oc-wrapper .gf-oc-check-text {
        display: inline !important;
    }

    /* Spans inline-flex (wrappers que llevan icono + texto al lado). */
    .gf-oc-wrapper .gf-oc-slider-current,
    .gf-oc-wrapper .gf-oc-check-icon {
        display: inline-flex !important;
    }

    /* Switch: track absolute + thumb relative (siguen funcionando con
       display:block, pero forzamos para evitar reflows raros). */
    .gf-oc-wrapper .gf-oc-switch-track,
    .gf-oc-wrapper .gf-oc-switch-thumb {
        display: block !important;
    }
}

/* ── Consentimiento legal (variables NEO RACC) ────────────────────── */
.gf-oc-consent { margin-top: var(--spacing-40); }
.gf-oc-consent-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-20);
    cursor: pointer;
    font-size: var(--font-small);
    line-height: var(--font-height-body);
}
.gf-oc-consent-input {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    accent-color: var(--color-racc-500);
}
.gf-oc-consent-link { text-decoration: underline; }
.gf-oc-consent-req { color: var(--color-error-500); }
.gf-oc-consent-error {
    margin: var(--spacing-10) 0 0;
    color: var(--color-error-500);
    font-size: var(--font-tiny);
    font-weight: var(--font-semibold);
}

/* Card apagada → consentimiento no interactivo */
.gf-oc-consent--disabled { opacity: .5; }
.gf-oc-consent--disabled .gf-oc-consent-label,
.gf-oc-consent-input:disabled { cursor: not-allowed; }
