/*
Theme Name: Nacho Puerto Custom
Description: Tema minimalista a medida.
Version: 1.0.0
*/

:root {
    /* Paleta Neutra Minimalista */
    --bg-color: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-light: #e0e0e0;

    /* Variables de Componentes */
    --card-bg: #1a1a1a;
    --card-text: #f5f5f5;
    --cell-dark: #888888;
    --cell-light: #b0b0b0;

    --section-spacing: 12rem; /* Separación masiva para CRO */
}

html {
    scroll-behavior: smooth;
    /* Ajuste para que el scroll no tape el título con el header sticky */
    scroll-padding-top: 80px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 0 2rem rgba(0, 0, 0, .1);

    /* Fix para recortes en scroll manual */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: .5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Branding */
.site-branding {
    display: flex;
    align-items: center;
}

.custom-logo-link {
    display: block;
    line-height: 0; /* Evita espacios extra abajo */
}

.custom-logo-link img {
    max-height: 64px;
    width: auto;
    display: block;
    transition: opacity 0.2s ease;
}

.custom-logo-link:hover img {
    opacity: 0.8; /* Efecto hover sutil */
}

/* Título de respaldo (si no hay logo cargado) */
.site-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Botón Hamburguesa (Oculto en Desktop) */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    position: relative;
    transition: background-color 0.3s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--text-main);
    left: 0;
    transition: transform 0.3s ease, top 0.3s ease;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

/* Animación Hamburguesa a Cruz */
.menu-toggle.is-active .hamburger {
    background-color: transparent;
}

.menu-toggle.is-active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle.is-active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4rem;
}

.nav-list a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-list a:hover {
    color: var(--text-main);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background-color: var(--bg-color);
    padding-top: 4rem;
    margin-top: 4rem;
}

.footer-top {
    text-align: center;
    padding-bottom: 3rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.social-icons a {
    color: var(--text-muted);
    text-decoration: none;
    transition: transform 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.social-icons a:hover {
    color: var(--text-main);
    transform: translateY(-2px);
}

.footer-contact-line {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
}

.footer-contact-line::before,
.footer-contact-line::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 30px;
    height: 1px;
    background-color: var(--border-light);
}

.footer-contact-line::before { left: -40px; }
.footer-contact-line::after { right: -40px; }

.footer-bottom {
    background-color: #1a1a1a;
    color: #888888;
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.85rem;
}

/* ==========================================================================
   RESPONSIVE MÓVIL
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --section-spacing: 6rem; /* Reducimos a la mitad en móvil */
    }

    .header-container {
        /* Fuerza la separación de los elementos a los extremos */
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap; /* Evita que el menú salte a otra línea si hay espacio */
        padding: .75rem 1.5rem;
    }

    .site-branding {
        flex: 0 1 auto; /* Permite que el logo mantenga su tamaño */
    }

    .custom-logo-link img {
        max-height: 56px;
    }

    .menu-toggle {
        display: block;
        margin: 0; /* Elimina márgenes automáticos que puedan centrarlo */
    }

    .main-navigation {
        /* Estado inicial (oculto) */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        border-bottom: 1px solid var(--border-light);
        padding: 1.5rem 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);

        /* Transición suave */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
    }

    .main-navigation.is-active {
        /* Estado activo (visible) */
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .footer-top {
        padding-bottom: 2rem;
    }
}
