/*
    ESTILOS GENERALES - TecnoBrújula
    Colores:
    - Principal: #1a365d (Azul Profundo - Confianza)
    - Acento: #3b82f6 (Azul Brillante - Tecnología/Acción)
    - Fondo: #f8fafc (Gris muy claro)
    - Texto: #334155 (Gris oscuro para lectura)
    - Blanco: #ffffff
*/

:root {
    --primary: #1a365d;
    --accent: #3b82f6;
    --bg-color: #f8fafc;
    --text-color: #334155;
    --text-light: #64748b;
    --white: #ffffff;
    --container-width: 1100px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* RESETEO GLOBAL DE LISTAS */
ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    list-style: none;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px; /* Padding base para escritorio y móvil */
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    display: block;
}

/* CABECERA */
.main-header {
    background-color: var(--white);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo img {
    height: 55px; /* Tamaño unificado según página Contacto */
    width: auto;
    display: block;
    transition: var(--transition);
}

.logo:hover img {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-color);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent);
}

/* MENU RESPONSIVE */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    width: 45px;
    height: 45px;
}

.hamburger {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--primary);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: var(--transition);
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 2px;
    background: var(--primary);
    left: 0;
    transition: var(--transition);
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: 8px; }

/* HERO */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #2c5282 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

/* ARTÍCULOS DESTACADOS */
.featured-posts {
    padding: 60px 0;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary);
    text-align: center;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

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

.post-content {
    padding: 20px;
}

.post-content h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.post-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.btn-read-more {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
}

/* ESTILOS DE ARTÍCULO INTERNO */
.article-container {
    max-width: 1000px;
    margin: 40px auto;
    background: var(--white);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.article-header h1 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.article-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.affiliate-disclaimer {
    font-size: 0.85rem;
    background: #eff6ff;
    padding: 15px;
    border-left: 4px solid var(--accent);
    color: var(--text-light);
    margin-bottom: 30px;
}

.featured-image img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 30px;
}

.article-body {
    font-size: 1.1rem;
    color: var(--text-color);
}

.article-body p {
    margin-bottom: 20px;
}

.article-body h2 {
    margin: 40px 0 20px;
    color: var(--primary);
}

/* LISTAS ESTILIZADAS EN ARTÍCULOS */
.article-body ul:not(.nav-links) {
    list-style: none;
    padding-left: 0;
}

.article-body ul:not(.nav-links) li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
}

.article-body ul:not(.nav-links) li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 18px;
    height: 18px;
    background-color: #d97706; /* Color ámbar acento */
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='3' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5' /%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='3' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m4.5 12.75 6 6 9-13.5' /%3E%3C/svg%3E") no-repeat center;
}

/* PRODUCT CARD - DISEÑO UNIFICADO */
.product-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #f8fafc; /* Color de fondo unificado */
    border-radius: 12px;
    margin: 40px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    overflow: hidden;
}

.product-img {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    padding-bottom: 10px;
}

.product-img img {
    width: 100%;
    max-width: 500px;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.product-info {
    padding: 35px;
    padding-top: 10px;
}

.product-info h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.rating {
    color: #f59e0b;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 20px 0;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.btn-amazon {
    display: block;
    width: 100%;
    max-width: 300px;
    background-color: #f59e0b;
    color: #fff;
    padding: 15px;
    text-align: center;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 auto;
}

/* FOOTER */
.main-footer {
    background-color: var(--primary);
    color: var(--white);
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-nav ul {
    display: flex;
    gap: 20px;
}

.footer-nav a {
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-nav a:hover {
    opacity: 1;
    color: var(--accent);
}

.footer-disclaimer {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 30px 0;
    margin-bottom: 20px;
    font-size: 0.85rem;
    opacity: 0.7;
}

.footer-bottom {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* PÁGINA DE CATEGORÍAS */
.category-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin: 40px 0;
    padding: 0; /* Asegurado */
}

.category-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: block;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

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

.category-info {
    padding: 20px;
}

.category-info h3 {
    margin-bottom: 5px;
    color: var(--primary);
}

.category-count {
    font-size: 0.85rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 5px;
}

.category-list {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.category-list a {
    color: var(--accent);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    margin-bottom: 10px;
}

.category-list a::before {
    content: '→';
}

.cat-featured { grid-column: span 8; }
.cat-featured img { height: 300px; }
.cat-normal { grid-column: span 4; }

@media (max-width: 768px) {
    /* 1. TÍTULOS MÁS COMPACTOS */
    .article-header h1 {
        font-size: 1.75rem !important; /* ~28px aprox */
        line-height: 1.3;
    }

    .article-body h2 {
        font-size: 1.5rem;
        margin: 30px 0 15px;
    }

    .product-info h3 {
        font-size: 1.4rem; /* Títulos de producto más proporcionales */
        margin-bottom: 10px;
    }

    /* 2. ESPACIADO REDUCIDO (PADDING/MARGIN) */
    .container {
        padding: 0 16px; /* Asegura un margen lateral consistente en todo el sitio móvil */
    }

    .article-container {
        margin: 20px auto;
        padding: 0; /* Quitamos padding extra para usar el del .container */
    }

    .product-card {
        flex-direction: column;
        padding: 15px;
        margin: 25px 0;
    }

    .product-img {
        padding: 15px;
        padding-bottom: 5px;
    }

    .product-info {
        padding: 15px;
        padding-top: 5px;
    }

    /* 3. AJUSTE DE LINE-HEIGHT Y TEXTO */
    .article-body p {
        font-size: 1rem;
        line-height: 1.5; /* De 1.6 a 1.5 para mayor compacidad */
        margin-bottom: 15px;
    }

    /* 4. IMAGEN DE PRODUCTO PROPORCIONAL */
    .product-img img {
        width: 100%;
        max-height: 250px; /* Reducción de 400px a 250px en móvil */
        object-fit: contain;
    }

    /* MENÚ MÓVIL */
    .menu-toggle {
        display: block;
        z-index: 1100;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        z-index: 1050;
        padding: 20px;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        font-size: 1.5rem;
        font-weight: 600;
    }

    .menu-toggle[aria-expanded="true"] .hamburger {
        background: transparent;
    }

    .menu-toggle[aria-expanded="true"] .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }

    .menu-toggle[aria-expanded="true"] .hamburger::after {
        transform: rotate(-45deg);
        bottom: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-nav ul {
        justify-content: center;
    }

    .hero h1 { font-size: 2rem; }
    .cat-featured, .cat-normal { grid-column: span 12; }
}
