/* =========================================
   VARIABLES Y CONFIGURACIÓN BASE
   Salud y Belleza - Paleta Rosa/Coral
   ========================================= */
:root { 
    --primary: #BE185D;           /* Rosa Profundo */
    --primary-light: #EC4899;     /* Rosa Claro para enlaces/botones */
    --accent: #F59E0B;            /* Dorado/Ámbar para "Bienestar" */
    --dark: #111827; 
    --light: #FFF7F9; 
    --text: #374151; 
    --white: #ffffff;
    --gray-light: #FDF2F8;
    --border: #FBBFCA;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    margin: 0; 
    color: var(--text); 
    background: var(--light); 
    line-height: 1.6; 
}

.container { 
    max-width: 1100px; 
    margin: auto; 
    padding: 0 20px; 
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }

/* =========================================
   HEADER Y NAVEGACIÓN
   ========================================= */
header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Buscador Moderno */
.search-form {
    display: flex;
    background: var(--gray-light);
    border-radius: 50px;
    padding: 5px 15px;
    border: 1px solid transparent;
}

.search-form:focus-within {
    border-color: var(--primary-light);
    background: var(--white);
}

.search-form input {
    border: none;
    background: transparent;
    padding: 8px;
    outline: none;
    color: var(--text);
}

/* Selector de Idiomas */
.lang-switcher a {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    color: var(--text);
}

.lang-switcher a.active {
    background: var(--primary);
    color: var(--white);
}

/* Navegación de Categorías */
.cat-nav {
    background: var(--primary);
    padding: 10px 0;
}

.cat-list {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.cat-list::-webkit-scrollbar { display: none; }

.cat-list a {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    font-weight: 500;
}

.cat-list a:hover { color: var(--white); }

/* =========================================
   GRID DE ARTÍCULOS (PORTADA)
   ========================================= */
.section-title {
    margin: 40px 0 20px;
    font-size: 1.8rem;
    color: var(--dark);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body { padding: 20px; }

.card-body h2 {
    font-size: 1.25rem;
    margin: 0 0 10px;
    color: var(--dark);
    line-height: 1.3;
}

.resumen-preview {
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.8;
}

/* =========================================
   VISTA DE ARTÍCULO DETALLADO
   ========================================= */
.recipe-container {
    max-width: 850px;
    margin: 40px auto;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.recipe-header img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
}

.recipe-content { padding: 40px; }

.badge-container { margin-bottom: 15px; }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 8px;
}

.badge-cat { background: var(--primary); color: var(--white); }

/* Estilo Tip Rápido */
.resumen-box {
    background-color: #FDF2F8;
    border-left: 5px solid var(--primary-light);
    padding: 25px;
    border-radius: 0 12px 12px 0;
    margin: 30px 0;
}

/* Estilo Ejemplo Práctico */
.ingredients-box {
    background: var(--gray-light);
    border: 2px dashed var(--border);
    padding: 30px;
    border-radius: 12px;
    margin: 40px 0;
}

.ingredients-box h3 { color: var(--primary); margin-top: 0; }

/* =========================================
   NAVEGACIÓN ENTRE ARTÍCULOS (ESTILO SALUD)
   ========================================= */
.nav-wrapper {
    margin-top: 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1px solid var(--border);
    padding-top: 40px;
}

.nav-card {
    background: var(--white);
    border: none;
    box-shadow: var(--shadow);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.nav-card img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 15px;
}

.nav-right {
    text-align: right;
    flex-direction: row-reverse;
}

.nav-right img {
    margin-right: 0;
    margin-left: 15px;
}

.nav-info {
    flex: 1;
}

.nav-label {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.nav-title {
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
    line-height: 1.3;
    display: block;
}

/* =========================================
   PAGINACIÓN
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    margin: 50px 0;
}

.pagination-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.page-link:hover {
    background: var(--gray-light);
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    pointer-events: none;
}

/* Responsive: en móvil una columna */
@media (max-width: 600px) {
    .nav-wrapper {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .nav-card img {
        width: 60px;
        height: 60px;
    }
    
    .nav-title {
        font-size: 0.9rem;
    }
}

/* =========================================
   ESTILOS DE CONTENEDORES DE ANUNCIOS (PRODUCCIÓN)
   ========================================= */

.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 20px auto;
    padding: 0;
    overflow: hidden;
    min-height: 280px;
    background: transparent;
}

/* Ocultar rastro visual de prueba */
.ad-container small,
.ad-container::before,
.ad-container::after {
    display: none !important;
    content: none !important;
}

/* Colapsar SOLO si Google AdSense explícitamente dice que no tiene anuncios (unfilled) */
ins.adsbygoogle[data-ad-status="unfilled"],
.ad-container:has(ins[data-ad-status="unfilled"]) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
}

/* Ajuste para anuncios en grid */
.grid .ad-container {
    grid-column: span 1 !important;
}

/* Clase de seguridad para forzar el colapso si el anuncio falla */
.ad-container.ad-hidden {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* =========================================
   FAQ & AI CONTEXT
   ========================================= */
.faq-ai-container {
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
}

.faq-ai-details {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    color: var(--text);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-ai-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    outline: none;
    padding: 20px 25px;
    background: var(--gray-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    transition: background 0.3s ease;
}

/* Ocultar la flecha por defecto del navegador */
.faq-ai-summary::-webkit-details-marker {
    display: none;
}

.faq-ai-summary:hover {
    background: #FCE7F3;
}

.faq-ai-icon {
    font-size: 0.9em;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

/* Girar la flecha al abrir el desplegable */
.faq-ai-details[open] .faq-ai-icon {
    transform: rotate(180deg);
}

.faq-ai-content {
    padding: 25px;
    border-top: 1px solid var(--border);
}

.faq-list {
    list-style: none;
    padding-left: 0;
    margin: 0 0 30px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-list li {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.faq-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-list li strong {
    color: var(--dark);
    display: block;
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.faq-list li span {
    color: var(--text);
    display: block;
}

.ai-context-title {
    color: var(--primary);
    margin-top: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mantenemos el bloque de código oscuro al estilo "terminal" para que destaque que es código */
.ai-context-pre {
    background: var(--dark);
    color: var(--accent);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.8rem;
    margin: 0;
    border: 1px solid var(--border);
}

/* =========================================
   DISEÑO RESPONSIVE
   ========================================= */
@media (max-width: 850px) {
    .nav-container { flex-direction: column; gap: 15px; }
    .header-right { width: 100%; justify-content: center; flex-wrap: wrap; }
    .search-form { width: 100%; order: 3; }
    .recipe-content { padding: 25px; }
    .recipe-header img { height: 250px; }
}

@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
    .section-title { font-size: 1.5rem; }
    .card-body h2 { font-size: 1.1rem; }
}
