/* ==========================================================================
   MEDIOS CMS - COMPONENT: CARDS, FEEDS & RADIUS
   Comportamiento responsivo de tarjetas, liberación de textos y redondeo global
   ========================================================================== */

/* REGLA GLOBAL: Desactivar efecto zoom en fotos en hover */
.group:hover img:not([class*="logo-"]), .group:hover .bg-cover, .group:hover [style*="background-image"],
a:hover img:not([class*="logo-"]), a:hover .bg-cover, a:hover [style*="background-image"],
article:hover img:not([class*="logo-"]), article:hover .bg-cover, article:hover [style*="background-image"],
.group:hover [class*="scale-"],
a:hover [class*="scale-"],
article:hover [class*="scale-"] {
    transform: none !important;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, filter, backdrop-filter !important;
}

/* Redondeo Global Dinámico (CMS Setting) */
img:where(:not(.rounded-full):not(.avatar):not([class*="logo-"]):not([src*="iso-medios"]):not(.logo-iso)),
button.rounded-full,
a.rounded-full,
.btn-action,
.nav-pill,
.btn-radio-live,
.rounded,
.rounded-md,
.rounded-lg,
.rounded-xl,
.rounded-2xl,
.rounded-3xl,
.rounded-t-2xl,
.rounded-b-2xl,
.rounded-r-xl,
.rounded-l-xl,
.rounded-t-xl,
.rounded-b-xl,
.rounded-r-2xl,
.rounded-l-2xl,
.news-card,
.widget,
.card,
.banner,
figure,
.hero-main,
.hero-side-item,
.thumbnail,
.cms-radius {
    border-radius: var(--cms-radius, 16px) !important;
}

/* Media Inicial (Imagen o Video) sin redondeo en móvil / encolumnado (< 1024px) */
@media (max-width: 1023px) {
    #cms-main-article .cms-single-featured-media,
    #cms-main-article .cms-single-featured-media *,
    .cms-single-featured-media,
    .cms-single-featured-media figure,
    .cms-single-featured-media figure img,
    .cms-single-featured-media img,
    .cms-single-featured-media figcaption,
    .cms-single-featured-media .aspect-video,
    .cms-single-featured-media iframe {
        border-radius: 0 !important;
        -webkit-border-radius: 0 !important;
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }
}

/* Esquinas direccionales con soporte para radio dinámico */
.rounded-t-2xl, .rounded-t-xl { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.rounded-b-2xl, .rounded-b-xl { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.rounded-l-2xl, .rounded-l-xl { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.rounded-r-2xl, .rounded-r-xl { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }

@media (min-width: 768px) {
    .md\:rounded-l-2xl, .md\:rounded-l-xl { 
        border-top-left-radius: var(--cms-radius, 16px) !important;
        border-bottom-left-radius: var(--cms-radius, 16px) !important;
        border-top-right-radius: 0 !important; 
        border-bottom-right-radius: 0 !important; 
    }
    .md\:rounded-t-2xl, .md\:rounded-t-xl {
        border-top-left-radius: var(--cms-radius, 16px) !important;
        border-top-right-radius: var(--cms-radius, 16px) !important;
        border-bottom-left-radius: 0 !important; 
        border-bottom-right-radius: 0 !important; 
    }
    .md\:rounded-none { border-radius: 0 !important; }
}

/* ==========================================================================
   FORMATO MÓVIL: LIBERACIÓN TOTAL DE CARDS Y TEXTOS (< 1024px)
   ========================================================================== */
@media (max-width: 1023px) {
    /* 1. Liberar cards del feed en móvil */
    article:not(#cms-main-article):not([class*="h-\["]),
    .card,
    .news-card,
    .hero-side-item,
    .grid article:not([class*="h-\["]),
    aside article {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: none !important;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
        align-self: auto !important;
    }

    /* Asegurar altura visible de la noticia destacada principal en móviles */
    [class*="hero-dynamic-grid-"] > article:first-child,
    [class*="hero-"] article[class*="h-\[420px\]"],
    [class*="hero-"] article.relative[class*="h-\["] {
        height: 420px !important;
        min-height: 380px !important;
        display: block !important;
        position: relative !important;
    }

    /* Layout horizontal de sub-destacadas */
    .hero-dynamic-grid-4 article a,
    [class*="hero-"] article a.flex,
    article a.flex {
        display: flex !important;
        flex-direction: row !important;
        height: 100% !important;
        width: 100% !important;
    }
    .hero-dynamic-grid-4 article a > div:first-child {
        min-width: 110px !important;
        min-height: 95px !important;
        align-self: stretch !important;
        flex-shrink: 0 !important;
    }

    /* 2. Liberar contenedores internos y de texto */
    article:not(#cms-main-article):not([class*="h-\["]) > div:not([class*="aspect-"]):not([class*="h-"]):not([class*="w-1/3"]):not([class*="min-w-"]),
    article:not(#cms-main-article):not([class*="h-\["]) [class*="p-"],
    article:not(#cms-main-article):not([class*="h-\["]) .flex-col,
    article:not(#cms-main-article):not([class*="h-\["]) .flex-grow {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* 3. Liberar columnas y contenedores de héroes y feeds */
    .hero-dynamic-grid-1,
    .hero-dynamic-grid-23,
    .hero-dynamic-grid-4,
    .hero-dynamic-grid-9,
    [class*="hero-"] .grid,
    [class*="hero-"] [class*="col-span"],
    [class*="hero-"] .flex-col {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    /* 4. Liberar limitación o corte de texto (line-clamp) en móvil */
    [class*="line-clamp-"],
    .line-clamp-1,
    .line-clamp-2,
    .line-clamp-3,
    .line-clamp-4,
    .line-clamp-5,
    .line-clamp-6,
    article [class*="line-clamp-"],
    article .typo-home_card_title,
    article .typo-home_card_p,
    article .typo-home_sec_title,
    article .typo-home_sec_p,
    article .typo-home_hero_title,
    article .typo-home_hero_p,
    article h1,
    article h2,
    article h3,
    article h4,
    article h5,
    article h6,
    article p {
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        display: block !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        text-overflow: unset !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    /* 5. Asegurar que pills y volantas nunca se estiren */
    article span[class*="rounded"],
    [class*="hero-"] span[class*="rounded"],
    article span[style*="background-color"],
    [class*="hero-"] span[style*="background-color"],
    article span[class*="uppercase"],
    [class*="hero-"] span[class*="uppercase"] {
        display: inline-flex !important;
        width: auto !important;
        max-width: max-content !important;
        align-self: flex-start !important;
        flex: none !important;
        white-space: nowrap !important;
    }
}


/* Líneas de separación en Hero 12 con contraste reforzado y elegante */
.hero12-divider,
.border-b.hero12-divider,
.border-t.hero12-divider {
  border-color: #a8a8a8 !important;
}

.dark .hero12-divider,
.dark .border-b.hero12-divider,
.dark .border-t.hero12-divider {
  border-color: rgba(255, 255, 255, 0.18) !important;
}


/* ============================================================
   SVC-CARD: Responsive 3-column cards (Clima, Horoscopo)
   ============================================================ */
.svc-card-row {
    display: flex !important;
    align-items: stretch !important;
    overflow: hidden !important;
}
.svc-card-col1 {
    flex: 0 0 130px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}
.svc-horoscopo-img,
.svc-card-col1 .svc-horoscopo-img {
    width: 80px !important;
    height: 80px !important;
    min-height: 80px !important;
    max-height: 80px !important;
    max-width: 80px !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    margin: 0 auto 6px auto !important;
    display: block !important;
}
.svc-card-col2 {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}
.svc-card-col3 {
    flex: 0 0 115px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.svc-col3-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
}
@media (max-width: 640px) {
    .svc-card-row { flex-direction: column !important; }
    /* Col1: imagen centrada, nombre abajo, fecha abajo — columna vertical centrada */
    .svc-card-col1 {
        width: 100% !important;
        flex: none !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        border-right: none !important;
        border-bottom: 1px solid #e9edf2 !important;
        padding: 14px 12px !important;
        text-align: center !important;
    }
    .svc-card-col1 img { max-width: 72px !important; width: 72px !important; height: auto !important; }
    .svc-horoscopo-img,
    .svc-card-col1 .svc-horoscopo-img {
        width: 72px !important;
        height: 72px !important;
        min-height: 72px !important;
        max-height: 72px !important;
        max-width: 72px !important;
        aspect-ratio: 1 / 1 !important;
    }
    /* Col2: texto predicción ancho completo */
    .svc-card-col2 {
        width: 100% !important;
        flex: none !important;
        padding: 14px 16px !important;
    }
    .svc-card-col2 > div { flex-wrap: wrap !important; gap: 8px 14px !important; }
    /* Clima: Métricas de la primera tarjeta compensadas 2x2 en móvil */
    .svc-card-clima-today .svc-card-col2 { padding: 14px 16px !important; }
    .svc-card-col2 > div.svc-clima-metrics,
    .svc-card-clima-today .svc-clima-metrics,
    .svc-clima-metrics {
        display: grid !important;
        grid-template-columns: repeat(2, auto) !important;
        justify-content: space-evenly !important;
        align-items: center !important;
        row-gap: 12px !important;
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }
    .svc-clima-metrics > div {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px !important;
    }
    .svc-clima-metrics svg {
        width: 22px !important;
        height: 22px !important;
        flex-shrink: 0 !important;
    }
    .svc-clima-metrics > div > div {
        display: flex !important;
        flex-direction: column !important;
        line-height: 1.2 !important;
    }
    .svc-clima-metrics span:first-child {
        font-size: 13px !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
    }
    .svc-clima-metrics span:last-child {
        font-size: 11px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }
    /* Col3: Suerte y Color en fila horizontal centrada */
    .svc-card-col3 {
        width: 100% !important;
        flex: none !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 32px !important;
        border-left: none !important;
        border-top: 1px solid #e9edf2 !important;
        padding: 12px 16px !important;
    }
    /* Col3 inner: SUERTE y COLOR en fila horizontal */
    .svc-col3-inner {
        flex-direction: row !important;
        gap: 28px !important;
        justify-content: center !important;
        width: 100% !important;
    }
}

/* ============================================================
   SVC-LOT: Quiniela / Loterias responsive (mobile)
   ============================================================ */
@media (max-width: 640px) {
    /* Stack: col1 arriba, col2 (numeros) abajo, col3 oculto o inline */
    .svc-lot-row {
        flex-direction: column !important;
    }
    .svc-lot-col1 {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        border-right: none !important;
        border-bottom: 1px solid #e9edf2 !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        padding: 12px 14px !important;
    }
    .svc-lot-col2 {
        flex: none !important;
        width: 100% !important;
        padding: 6px 4px !important;
        grid-template-columns: repeat(4, 1fr) !important;
        column-gap: 0 !important;
    }
    .svc-lot-col2 div > small {
        font-size: 10px !important;
        min-width: 16px !important;
    }
    .svc-lot-col2 div > span {
        font-size: 16px !important;
    }
    .svc-lot-col3 {
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
        border-left: none !important;
        border-top: 1px solid #e9edf2 !important;
        padding: 10px 14px !important;
        justify-content: flex-start !important;
        gap: 8px !important;
    }
}

/* =========================================================================
   Dólar Canónico: Layout 3 Columnas Unificado (Sincronizado con Quinielas y Clima)
   ========================================================================= */
.svc-dolar-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    margin-bottom: 14px;
}
.svc-dolar-col1 {
    flex: 0 0 210px;
    min-width: 190px;
    max-width: 230px;
    background: #f8fafc;
    border-right: 1px solid #e9edf2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 14px 18px;
}
.svc-dolar-col2 {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    gap: 16px;
    background: #ffffff;
}
.svc-dolar-col3 {
    flex: 0 0 115px;
    min-width: 105px;
    max-width: 120px;
    background: #f8fafc;
    border-left: 1px solid #e9edf2;
    padding: 14px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dark .svc-dolar-row {
    background: #1e293b;
    border-color: #334155;
}
.dark .svc-dolar-col1,
.dark .svc-dolar-col3 {
    background: #0f172a;
    border-color: #334155;
}
.dark .svc-dolar-col2 {
    background: #1e293b;
}
.svc-dolar-intro {
    margin-top: 0 !important;
    margin-bottom: 26px !important;
    line-height: 1.6 !important;
}

/* ==========================================================================
   Servicio Farmacias de Turno - Card Unificada de 3 Columnas
   ========================================================================== */
.svc-farmacia-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    margin-bottom: 14px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.svc-farmacia-row:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}
.svc-farmacia-col1 {
    flex: 0 0 240px;
    min-width: 210px;
    max-width: 270px;
    border-right: 1px solid #e9edf2;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    align-self: stretch;
}
.svc-farmacia-col1 img,
.cms-single-body .svc-farmacia-col1 img,
.cms-article-body .svc-farmacia-col1 img,
.prose .svc-farmacia-col1 img {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: block !important;
}
.svc-farmacia-col2 {
    flex: 1 1 0;
    min-width: 0;
    background: #ffffff;
    padding: 16px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}
.svc-farmacia-col3 {
    flex: 0 0 100px;
    min-width: 90px;
    max-width: 110px;
    background: #f8fafc;
    border-left: 1px solid #e9edf2;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.svc-farmacia-btn-wa,
.svc-farmacia-btn-maps {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.svc-farmacia-btn-wa:hover,
.svc-farmacia-btn-maps:hover {
    transform: scale(1.1);
}
.svc-farmacia-intro {
    margin-top: 0 !important;
    margin-bottom: 24px !important;
    line-height: 1.6 !important;
}
.dark .svc-farmacia-row {
    background: #1e293b;
    border-color: #334155;
}
.dark .svc-farmacia-col1 {
    border-color: #334155;
    background: #0f172a;
}
.dark .svc-farmacia-col2 {
    background: #1e293b;
}
.dark .svc-farmacia-col3 {
    background: #0f172a;
    border-color: #334155;
}
@media (max-width: 768px) {
    .svc-farmacia-row {
        flex-direction: column !important;
    }
    .svc-farmacia-col1 {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 180px !important;
        border-right: none !important;
        border-bottom: 1px solid #e9edf2 !important;
    }
    .svc-farmacia-col2 {
        flex: none !important;
        width: 100% !important;
        padding: 14px 16px !important;
    }
    .svc-farmacia-col3 {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        border-left: none !important;
        border-top: 1px solid #e9edf2 !important;
        padding: 12px 16px !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 24px !important;
    }
}
@media (max-width: 768px) {
    .svc-dolar-row {
        flex-direction: column !important;
    }
    .svc-dolar-col1 {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e9edf2 !important;
        padding: 12px 16px !important;
    }
    .svc-dolar-sparkline-wrap {
        display: none !important;
    }
    .svc-dolar-col2 {
        flex: none !important;
        width: 100% !important;
        padding: 14px 16px !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
    }
    .svc-dolar-col2 .svc-dolar-prices {
        margin-left: 0 !important;
        width: 100% !important;
        justify-content: space-around !important;
    }
    .svc-dolar-col3 {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        border-left: none !important;
        border-top: 1px solid #e9edf2 !important;
        padding: 10px 16px !important;
    }
}
