/**
 * Estilos CSS para SF Ads Manager Frontend
 * Basado en tu archivo assets/styles/widgets.scss
 */

/* === DEVICE TARGETING (v2) === */
/* Ocultar por defecto los elementos que tienen targeting para evitar FOUC */
[data-device-target],
[data-hide-on] {
    display: none;
}

/* Fallback: Si JavaScript no se carga en 3 segundos, mostrar elementos sin targeting específico */
.sf-no-js [data-device-target=""],
.sf-no-js [data-hide-on=""] {
    display: block;
}

/* Cuando JS está listo, muestra solo los elementos visibles para el dispositivo actual */
.sf-ads-device-ready [data-device-target].sf-ads-device-visible,
.sf-ads-device-ready [data-hide-on].sf-ads-device-visible {
    display: block;
}

/* Casos especiales para contenedores flex/grid */
.sf-ads-device-ready .sf-ads-group[data-device-target].sf-ads-device-visible,
.sf-ads-device-ready .sf-ads-group[data-hide-on].sf-ads-device-visible {
    display: flex;
}

.sf-ads-device-ready .sf-ads-group.sf-ads-horizontal[data-device-target].sf-ads-device-visible,
.sf-ads-device-ready .sf-ads-group.sf-ads-horizontal[data-hide-on].sf-ads-device-visible {
    display: flex;
}

.sf-ads-device-ready .sf-ads-group.sf-ads-vertical[data-device-target].sf-ads-device-visible,
.sf-ads-device-ready .sf-ads-group.sf-ads-vertical[data-hide-on].sf-ads-device-visible {
    display: flex;
    flex-direction: column;
}

.sf-ads-device-ready .sf-ads-mosaic-container[data-device-target].sf-ads-device-visible,
.sf-ads-device-ready .sf-ads-mosaic-container[data-hide-on].sf-ads-device-visible {
    display: grid;
}

/* Debug: Mostrar elementos antes de que se procesen (solo para desarrollo) */
/* Descomenta la siguiente línea para debug:
[data-device-target], [data-hide-on] {
    display: block !important;
    border: 2px dashed red;
    background: rgba(255,0,0,0.1);
}
*/

/* === CONTENEDORES PRINCIPALES === */
.sf-ads-single,
.sf-ads-group {
    margin: 20px 0;
    text-align: center;
    overflow: visible;
    min-width: 300px;
}

.sf-ads-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.sf-ads-group .sf-ads-single {
    flex: 1;
    min-width: 300px;
    max-width: 100%;
}

/* === ADSENSE OPTIMIZATIONS === */
.sf-ads-single .adsbygoogle,
.sf-ads-group .adsbygoogle {
    min-width: 300px !important;
    min-height: 250px !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto;
}

.sf-ads-single ins.adsbygoogle,
.sf-ads-group ins.adsbygoogle {
    min-width: 300px !important;
    min-height: 250px !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    background: transparent;
}

/* Asegurar que los contenedores padre tengan el tamaño correcto */
.sf-ads-single[data-type="html"],
.sf-ads-single[data-type="adsense"] {
    min-width: 300px;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* === TIPOS DE ANUNCIOS === */

/* Anuncios de imagen */
.sf-ads-image {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sf-ads-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sf-ads-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Anuncios de video */
.sf-ads-video {
    position: relative;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sf-ads-video-element {
    width: 100%;
    height: auto;
    display: block;
}

/* Contenedor de video externo */
.sf-ads-video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sf-ads-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Enlaces de video */
.sf-ads-video-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.sf-ads-video-link:hover {
    transform: translateY(-2px);
}

.sf-ads-video-link a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sf-ads-video-link a:before {
    content: "▶";
    font-size: 14px;
}

/* Anuncios iframe */
.sf-ads-iframe-container {
    position: relative;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sf-ads-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Anuncios HTML */
.sf-ads-html {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === ENLACES === */
.sf-ads-link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.sf-ads-link:hover {
    opacity: 0.9;
}

/* === LAYOUTS DE GRUPO === */

/* Layouts de grupo */
.sf-ads-group {
    margin: 10px 0;
    clear: both;
}

/* Layout horizontal */
.sf-ads-horizontal-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.sf-ads-horizontal-item {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

/* Layout vertical */
.sf-ads-vertical-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sf-ads-vertical-item {
    width: 100%;
}

/* Layout mosaico */
.sf-ads-mosaic-container {
    display: grid;
    gap: 10px;
    margin: 10px 0;
}

.sf-ads-mosaic-2x2 {
    grid-template-columns: repeat(2, 1fr);
}

.sf-ads-mosaic-3x3 {
    grid-template-columns: repeat(3, 1fr);
}

.sf-ads-mosaic-4x4 {
    grid-template-columns: repeat(4, 1fr);
}

.sf-ads-mosaic-2x4 {
    grid-template-columns: repeat(2, 1fr);
}

.sf-ads-mosaic-4x2 {
    grid-template-columns: repeat(4, 1fr);
}

.sf-ads-mosaic-item {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsividad para mosaicos */
@media (max-width: 768px) {

    .sf-ads-mosaic-4x4,
    .sf-ads-mosaic-4x2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sf-ads-mosaic-3x3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sf-ads-horizontal-container {
        flex-direction: column;
    }

    .sf-ads-horizontal-item {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .sf-ads-mosaic-container {
        grid-template-columns: 1fr;
    }
}

/* === RESPONSIVE === */

/* Tablets */
@media (max-width: 768px) {
    .sf-ads-group.layout-horizontal {
        flex-direction: column;
    }

    .sf-ads-group.layout-mosaic-4x4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sf-ads-group.layout-mosaic-3x3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sf-ads-single,
    .sf-ads-group .sf-ads-single {
        min-width: auto;
        max-width: 100%;
    }
}

/* Móviles */
@media (max-width: 480px) {

    .sf-ads-group.layout-mosaic-2x2,
    .sf-ads-group.layout-mosaic-3x3,
    .sf-ads-group.layout-mosaic-4x4 {
        grid-template-columns: 1fr;
    }

    .sf-ads-single,
    .sf-ads-group {
        margin: 15px 0;
    }

    .sf-ads-group {
        gap: 10px;
    }
}

/* === ANIMACIONES === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sf-ads-single {
    animation: fadeIn 0.6s ease-out;
}

.sf-ads-group .sf-ads-single {
    animation-delay: calc(var(--item-index, 0) * 0.1s);
}

/* === UTILIDADES === */

/* Centrado */
.sf-ads-center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Flotante izquierda */
.sf-ads-float-left {
    float: left;
    margin-right: 20px;
    margin-bottom: 15px;
}

/* Flotante derecha */
.sf-ads-float-right {
    float: right;
    margin-left: 20px;
    margin-bottom: 15px;
}

/* Ancho completo */
.sf-ads-full-width {
    width: 100%;
    max-width: none;
}

/* === WIDGETS DE SIDEBAR === */
.widget .sf-ads-single {
    margin: 10px 0;
}

.widget .sf-ads-group {
    margin: 10px 0;
    gap: 10px;
}

.widget .sf-ads-image,
.widget .sf-ads-video,
.widget .sf-ads-video-container,
.widget .sf-ads-iframe-container,
.widget .sf-ads-html {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* === LOADING === */
.sf-ads-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.sf-ads-loading:before {
    content: "";
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid #ddd;
    border-top-color: #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === TEMAS === */

/* Tema oscuro */
.sf-ads-dark .sf-ads-single,
.sf-ads-dark .sf-ads-group {
    background-color: #2d2d2d;
    color: #fff;
}

.sf-ads-dark .sf-ads-video-link {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

/* Tema minimalista */
.sf-ads-minimal .sf-ads-image,
.sf-ads-minimal .sf-ads-video,
.sf-ads-minimal .sf-ads-video-container,
.sf-ads-minimal .sf-ads-iframe-container,
.sf-ads-minimal .sf-ads-html {
    box-shadow: none;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.sf-ads-minimal .sf-ads-image:hover,
.sf-ads-minimal .sf-ads-video:hover {
    transform: none;
    border-color: #cbd5e0;
}

/* === IMPRESIÓN === */
@media print {

    .sf-ads-single,
    .sf-ads-group {
        display: none !important;
    }
}

/* === ESTILOS POR POSICIÓN === */

/* Anuncios en contenido principal */
.sf-ads-single[data-position="content"] {
    width: 100%;
    max-width: 728px;
    margin: 30px auto;
}

.sf-ads-single[data-position="content"] .sf-ads-image {
    max-width: 100%;
}

/* Anuncios en sidebar */
.sf-ads-single[data-position="sidebar"] {
    width: 100%;
    max-width: 300px;
    margin: 15px 0;
}

.sf-ads-single[data-position="sidebar"] .sf-ads-image {
    max-width: 300px;
}

/* Anuncios en header */
.sf-ads-single[data-position="header"] {
    width: 100%;
    max-width: 970px;
    margin: 10px auto;
}

.sf-ads-single[data-position="header"] .sf-ads-image {
    max-width: 970px;
}

/* Anuncios en footer */
.sf-ads-single[data-position="footer"] {
    width: 100%;
    max-width: 970px;
    margin: 20px auto;
    text-align: center;
}

.sf-ads-single[data-position="footer"] .sf-ads-image {
    max-width: 970px;
}

/* Anuncios en widgets */
.sf-ads-single[data-position="widget"] {
    width: 100%;
    margin: 10px 0;
}

.sf-ads-single[data-position="widget"] .sf-ads-image {
    max-width: 100%;
}

/* Anuncios en popup/modal */
.sf-ads-single[data-position="popup"] {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
}

.sf-ads-single[data-position="popup"] .sf-ads-image {
    max-width: 500px;
}

/* === ESTILOS PARA INTERSTICIALES === */

/* SF Ads Interstitials v2.1 */
.sf-ads-interstitial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-ads-interstitial-content {
    position: relative;
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    border-top: 10px solid #e8280b;
}

.sf-ads-interstitial-close {
    position: absolute;
    top: -2px;
    right: -2px;
    background: white;
    border: 2px solid #e8280b;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: #e8280b;
    width: 32px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 0 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(232, 40, 11, 0.2);
    z-index: 10;
}

.sf-ads-interstitial-close:hover {
    background: #f8f9fa;
    color: #c41e02;
    border-color: #c41e02;
    box-shadow: 0 4px 12px rgba(232, 40, 11, 0.3);
    transform: translateY(-1px);
}

.sf-ads-interstitial-ad,
.sf-ads-interstitial-group,
.sf-ads-interstitial-shortcode {
    margin-bottom: 15px;
}

.sf-ads-interstitial-ad:last-child,
.sf-ads-interstitial-group:last-child,
.sf-ads-interstitial-shortcode:last-child {
    margin-bottom: 0;
}

/* Animations */
.sf-ads-interstitial-overlay.fade-in {
    animation: sf-interstitial-fade-in 0.3s ease-out;
}

@keyframes sf-interstitial-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive para intersticiales */
@media (max-width: 768px) {
    .sf-ads-interstitial-content {
        margin: 20px;
        padding: 20px;
        max-width: calc(100% - 40px);
        max-height: calc(100% - 40px);
    }

    /* En móvil/tablet: limitar el intersticial (modal legacy) a 1/4 de pantalla. */
    .sf-ads-interstitial-overlay .sf-ads-interstitial-content {
        max-height: 25vh;
        overflow: auto;
    }

    .sf-ads-interstitial-overlay .sf-ads-interstitial-body {
        max-height: calc(25vh - 40px);
        overflow: auto;
    }

    /* Evitar que AdSense fuerce alturas mínimas y haga crecer el modal */
    .sf-ads-interstitial-overlay .adsbygoogle,
    .sf-ads-interstitial-overlay ins.adsbygoogle,
    .sf-ads-interstitial-overlay iframe {
        min-height: 0 !important;
        max-height: 100% !important;
        max-width: 100% !important;
    }
}

/* =====================================================================
   NUEVO FALDÓN LIMPIO (2026) - clases nuevas: axp-ads-sheet
   - Solo móvil/tablet vertical (lo decide JS)
   - Altura fija: 25vh
   - Sin dependencia del overlay/intersticial antiguo
   ===================================================================== */

.axp-ads-sheet {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.axp-ads-sheet__backdrop {
    position: absolute;
    inset: 0;
    /* NO oscurecer el fondo: backdrop transparente */
    background: transparent;
}

.axp-ads-sheet__panel {
    position: relative;
    width: 100%;
    height: 150px;
    max-height: 150px;
    min-height: 150px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 0;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.axp-ads-sheet__close {
    position: absolute;
    bottom: 150px;
    right: 0;
    width: 44px;
    height: 28px;
    border: 2px solid #e8280b;
    border-bottom: none;
    border-right: none;
    border-radius: 14px 0 0 0;
    background: #fff;
    color: #e8280b;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    box-shadow: -2px -2px 10px rgba(0, 0, 0, 0.12);
}

.axp-ads-sheet__body {
    height: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.axp-ads-sheet__body>* {
    max-width: 100%;
}

/* Mantener el contenido centrado y sin desbordes raros */
.axp-ads-sheet__body .sf-ads-single,
.axp-ads-sheet__body .sf-ads-group,
.axp-ads-sheet__body .sf-ads-code {
    max-width: 100%;
}

/* AdSense responsive (data-ad-format="auto") dentro del faldón fijo */
.axp-ads-sheet__body ins.adsbygoogle,
.axp-ads-sheet__body .adsbygoogle {
    display: block !important;
    width: 100% !important;
    height: 150px !important;
    max-height: 150px !important;
    overflow: hidden !important;
}

.axp-ads-sheet__body iframe {
    height: 150px !important;
    max-height: 150px !important;
}

.axp-ads-sheet__body iframe,
.axp-ads-sheet__body .adsbygoogle,
.axp-ads-sheet__body ins.adsbygoogle {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Anuncio fijo (360x90) centrado + escalado si hace falta */
.axp-ads-sheet__adslot {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
}

/* Mantener el tamaño fijo del slot (360x90) centrado */
.axp-ads-sheet__adslot ins.adsbygoogle {
    width: 360px !important;
    height: 90px !important;
}

/* Sin scroll: el faldón solo muestra el anuncio */

/* Excepciones específicas para el shortcode de cliente (dentro del nuevo faldón) */
.axp-ads-sheet__body .axp-intersticial-cliente {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.axp-ads-sheet__body .axp-intersticial-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr !important;
    gap: 0 !important;
    width: 100% !important;
    height: 120px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.axp-ads-sheet__body .axp-intersticial-imagen {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    background: #f5f5f5 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
}

.axp-ads-sheet__body .axp-intersticial-imagen img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

.axp-ads-sheet__body .axp-intersticial-contenido {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0.75rem !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    overflow: hidden !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Estilos específicos para el texto del cliente en el faldón */
.axp-ads-sheet__body .axp-intersticial-titulo {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #2c3e50 !important;
    text-shadow: none !important;
    margin: 0 0 0.4rem 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.axp-ads-sheet__body .axp-intersticial-descripcion {
    font-size: 0.75rem !important;
    color: #6c757d !important;
    text-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex-grow: 1 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.axp-ads-sheet__body .sf-ads-single:hover,
.axp-ads-sheet__body .sf-ads-group:hover {
    transform: scale(1.02) !important;
}

.axp-ads-sheet__body .sf-ads-single img,
.axp-ads-sheet__body .sf-ads-group img {
    max-height: 18vh !important;
    /* Ajustado para el 25vh total */
    max-width: 90% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

.axp-ads-sheet__body .sf-ads-single img:hover,
.axp-ads-sheet__body .sf-ads-group img:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-2px) !important;
}

/* Texto y contenido adicional */
.axp-ads-sheet__body .sf-ads-single .sf-ads-text,
.axp-ads-sheet__body .sf-ads-group .sf-ads-text,
.axp-ads-sheet__body p,
.axp-ads-sheet__body h1,
.axp-ads-sheet__body h2,
.axp-ads-sheet__body h3 {
    color: #333 !important;
    text-align: center !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
    margin: 8px 0 !important;
    line-height: 1.4 !important;
}

/* Animación de entrada suave */
.axp-ads-sheet__panel {
    animation: axp-sheet-slide-up 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes axp-sheet-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.penci-header-wrap.pc-wrapbuilder-header {
    margin-bottom: 0;
}

.header-space {
    margin-bottom: 30px;
}

@media (max-width: 768px) {

    .penci_mobile_bottombar .penci_nav_col {
        padding: 5px;
    }

    .penci_navbar_mobile .container .sf-ads-single,
    .sf-ads-group {
        padding: 5px !important;
        margin: 0 !important;
    }


    .sf-ads-single[data-position="header"] {
        width: 100%;
        max-width: 768px;
        margin: 0;
    }
}

/* === INTERSTICIALES LAZY LOADING === */
.sf-ads-loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 10px;
}

.sf-ads-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: sf-ads-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes sf-ads-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.sf-ads-loading-placeholder p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 14px;
}

.sf-ads-lazy-load.sf-ads-loaded .sf-ads-loading-placeholder {
    display: none;
}

/* Asegurar que el contenido lazy cargado sea visible */
.sf-ads-lazy-load.sf-ads-loaded {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* Efecto suave cuando se carga el contenido */
.sf-ads-lazy-load:not(.sf-ads-loaded) {
    opacity: 0.7;
}

/* Intersticiales - Optimizaciones específicas para Google AdSense */
.sf-ads-interstitial-overlay .adsbygoogle {
    min-height: 250px;
    min-width: 300px;
    display: block !important;
    width: auto !important;
    height: auto !important;
}

.sf-ads-interstitial-overlay ins.adsbygoogle {
    background: transparent;
    display: block !important;
    min-width: 300px;
    min-height: 250px;
}

/* Asegurar que los contenedores de intersticiales tengan dimensiones apropiadas */
.sf-ads-interstitial-content {
    min-width: 320px;
    max-width: 90vw;
    width: auto;
    display: block;
}

.sf-ads-interstitial-body {
    min-width: 300px;
    width: 100%;
    display: block;
    position: relative;
}

/* Mejoras para el contenido lazy load */
.sf-ads-interstitial-ad,
.sf-ads-interstitial-group,
.sf-ads-interstitial-shortcode {
    width: 100%;
    max-width: 100%;
    min-width: 300px;
    overflow: visible;
    display: block;
}

.sf-ads-interstitial-ad .sf-ads-single,
.sf-ads-interstitial-group .sf-ads-group {
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 300px;
    display: block;
}

/* Específico para anuncios dentro de intersticiales */
.sf-ads-interstitial-ad .sf-ads-single .adsbygoogle,
.sf-ads-interstitial-group .sf-ads-group .adsbygoogle {
    min-width: 300px !important;
    min-height: 250px !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
}

/* Loading placeholder responsivo */
@media (max-width: 768px) {
    .sf-ads-loading-placeholder {
        min-height: 150px;
        padding: 15px;
    }

    .sf-ads-spinner {
        width: 25px;
        height: 25px;
        border-width: 2px;
    }

    .sf-ads-loading-placeholder p {
        font-size: 12px;
    }

    /* Ajustes móviles para AdSense */
    .sf-ads-interstitial-overlay .adsbygoogle {
        min-width: 280px;
        min-height: 200px;
    }

    .sf-ads-interstitial-content {
        min-width: 280px;
        max-width: 95vw;
    }

    .sf-ads-interstitial-body {
        min-width: 280px;
    }

    .sf-ads-interstitial-ad,
    .sf-ads-interstitial-group,
    .sf-ads-interstitial-shortcode {
        min-width: 280px;
    }
}
