/* ============================================
   SISTEMA DE PUBLICIDAD - INKABOX EXPRESS
   ============================================ */

/* Variables */
:root {
    --ad-border: #e0e0e0;
    --ad-bg: #f8f9fa;
    --ad-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================
   TOP BANNER - Banner Superior
   ============================================ */
.top-ad-banner {
    background: #325aa6;
    padding: 8px 0;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    min-height: 40px;
    transition: transform 0.3s ease;
}

.top-ad-banner .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.top-ad-banner .ad-content {
    color: white;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.top-ad-banner .ad-content strong {
    font-weight: 700;
    font-size: 14px;
}

.top-ad-banner .ad-cta {
    background: white;
    color: #667eea;
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.top-ad-banner .ad-cta:hover {
    transform: scale(1.05);
}

.top-ad-banner .close-ad {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.top-ad-banner .close-ad:hover {
    background: rgba(255,255,255,0.3);
}

/* ============================================
   SIDEBAR ADS - Banners Laterales Sticky
   ============================================ */
/* COMENTADO - Conflicto con css/sidebars.css del CMS
.sidebar-ads-container {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: none;
}
*/

/* COMENTADO - Conflicto con css/sidebars.css
.sidebar-ads-container.left {
    left: 5px;
}

.sidebar-ads-container.right {
    right: 5px;
}
*/

.sidebar-ad {
    width: 170px;
    height: 900px;
    background: white;
    border: 1px solid var(--ad-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--ad-shadow);
    transition: transform 0.3s ease;
}

.sidebar-ad:hover {
    transform: scale(1.02);
}

.sidebar-ad img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ajusta la imagen para llenar el espacio */
    display: block;
}

.sidebar-ad .ad-label {
    background: var(--ad-bg);
    padding: 4px 8px;
    font-size: 10px;
    color: #666;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mostrar solo en pantallas grandes */
@media (min-width: 1400px) {
    .sidebar-ads-container {
        display: block;
    }
}

/* ============================================
   VIDEO SECTION - Sección de Video
   ============================================ */
.video-promo-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.video-promo-section .section-header {
    margin-bottom: 40px;
}

.video-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

/* ============================================
   INLINE ADS - Banners entre Secciones
   ============================================ */
.inline-ad {
    padding: 40px 0;
    background: var(--ad-bg);
    border-top: 1px solid var(--ad-border);
    border-bottom: 1px solid var(--ad-border);
}

.inline-ad .container {
    max-width: 970px;
}

.inline-ad-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: var(--ad-shadow);
}

.inline-ad-image {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
}

.inline-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inline-ad-text {
    flex: 1;
}

.inline-ad-text h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.inline-ad-text p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.inline-ad-text .btn {
    display: inline-block;
}

.inline-ad .ad-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* ============================================
   POPUP AD - Anuncio Emergente
   ============================================ */
.popup-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.popup-ad-overlay.active {
    display: flex;
}

.popup-ad-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    animation: slideUp 0.4s ease;
}

.popup-ad-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 1;
    transition: background 0.3s ease;
}

.popup-ad-close:hover {
    background: rgba(0,0,0,0.7);
}

.popup-ad-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.popup-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-ad-body {
    padding: 30px;
}

.popup-ad-body h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

.popup-ad-body p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

.popup-ad-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.popup-ad-actions .btn {
    flex: none;
    min-width: 200px;
}

/* ============================================
   BANNER GRID - Grid de Banners
   ============================================ */
.banner-grid-section {
    padding: 60px 0;
    background: white;
}

.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.banner-card {
    background: white;
    border: 1px solid var(--ad-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.banner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.banner-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.banner-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.banner-card:hover .banner-card-image img {
    transform: scale(1.1);
}

.banner-card-content {
    padding: 20px;
}

.banner-card-content h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.banner-card-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .inline-ad-content {
        flex-direction: column;
        text-align: center;
    }
    
    .inline-ad-image {
        width: 100%;
        height: 200px;
    }
    
    .popup-ad-content {
        width: 95%;
    }
    
    .popup-ad-image {
        height: 200px;
    }
    
    .popup-ad-body {
        padding: 20px;
    }
    
    .popup-ad-body h2 {
        font-size: 22px;
    }
    
    .popup-ad-actions {
        flex-direction: column;
    }
    
    .top-ad-banner .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .banner-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   POPUP AD
   ============================================ */
.popup-ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-ad-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-ad-content {
    background: white;
    border-radius: 20px;
    width: 500px;
    height: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

/* Popup solo imagen */
.popup-ad-content.image-only {
    padding: 0;
    cursor: pointer;
}

.popup-ad-content.image-only .popup-ad-image {
    width: 100%;
    height: 100%;
    border-radius: 20px;
}

.popup-ad-content.image-only .popup-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

/* Popup con texto */
.popup-ad-content.text-only {
    display: flex;
    flex-direction: column;
    padding: 40px;
}

@keyframes popupSlideIn {
    from {
        transform: scale(0.8) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popup-ad-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.popup-ad-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.popup-ad-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.popup-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-ad-body {
    padding: 30px;
}

.popup-ad-body h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.popup-ad-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 25px;
    text-align: justify;
}

.popup-ad-description ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.popup-ad-description li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.popup-ad-description li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.popup-ad-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.popup-ad-actions .btn {
    flex: none;
    min-width: 200px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-popup-primary {
    background: #007bff !important;
    color: white !important;
    border: none !important;
}

.btn-popup-primary:hover {
    background: #0056b3 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.4);
}

/* Botón secundario eliminado - solo se usa el botón principal */

/* Responsive */
@media (max-width: 768px) {
    .popup-ad-content {
        width: 350px;
        height: 350px;
    }
    
    .popup-ad-content.text-only {
        padding: 25px;
    }
    
    .popup-ad-body h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .popup-ad-description {
        font-size: 0.9rem;
        margin-bottom: 20px;
        text-align: justify;
    }
    
    .popup-ad-actions .btn {
        width: 100%;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .popup-ad-content {
        width: 300px;
        height: 300px;
    }
    
    .popup-ad-content.text-only {
        padding: 20px;
    }
    
    .popup-ad-body h2 {
        font-size: 1.2rem;
        margin-bottom: 12px;
        text-align: center;
    }
    
    .popup-ad-description {
        font-size: 0.85rem;
        margin-bottom: 15px;
        text-align: justify;
    }
}
