/* ================================================================
   1. VARIABLES DE MARCA Y CONFIGURACIÓN BASE
   ================================================================ */
:root {
    /* Paleta Principal */
    --morado: #513682;
    --rose: #513682;
    --verde: #18C79A;
    --verde-claudia: #18C79A;
    --blanco: #ffffff;
    --gris-fondo: #ffffff;
    --negro: #000000;
    --bg-header: rgba(107, 72, 173, 0.479);

    --texto-dark: #2d2d2d;
    --text-dark: #2f2445;
    --gris-texto: #bbbbbb;
    --text-muted: #6f6780;

    --amarillo-aviso: #FFD700;
    --sombra: 0 10px 30px rgba(81, 54, 130, 0.12);
    --borde-suave: #e0e0e0;
    --border-soft: rgba(81, 54, 130, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--gris-fondo);
    color: var(--texto-dark);
}

/* ================================================================
   2. CONFIGURACIÓN GLOBAL PARA PANTALLA COMPLETA
   ================================================================ */
.main-container.full-page {
    display: block !important;
    width: 100% !important;
}

.main-container.full-page .visual-side {
    display: none !important;
}

.main-container.full-page .content-side {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    display: block !important;
}

/* ================================================================
   3. HEADER ESTILO NUTRIFORMA (TIENDA)
   ================================================================ */
.shop-header {
    width: 100%;
    z-index: 1000;
    position: sticky;
    top: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px 0;
    background-color: var(--morado);
    box-shadow: 0 0 0 100vmax var(--morado);
    clip-path: inset(0 -100vmax 0 -100vmax);
}

.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    gap: 30px;
}

.search-box {
    flex-grow: 1;
    max-width: 600px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 4px;
    border: none;
    font-size: 1rem;
    outline: none;
    background: #ffffff;
    color: white;
    transition: 0.3s;
}

.search-box input:focus {
    background: white;
    color: var(--texto-dark);
}

.cart-trigger {
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative; /* ¡Esto es clave! Convierte al icono en la base para el círculo */
}

#cart-count {
    position: absolute; /* Saca al círculo de la línea normal */
    top: -13px; /* Lo sube por encima del icono */
    right: -15px; /* Lo empuja hacia la derecha */
    background: var(--verde);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

/* ================================================================
   4. SITE HEADER (VERSIÓN TRANSPARENTE/BLUR)
   ================================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: space-between;
}

/* ESTILOS DEL MENÚ HAMBURGUESA */
.hamburger-menu {
    display: none;
    /* Oculto por defecto en computadoras */
    cursor: pointer;
    color: var(--rose);
}

.close-menu {
    display: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 0;
}

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 14px;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}

.brand-name {
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--rose);
    font-size: 1rem;
}

.brand-tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 14px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
    background: rgba(81, 54, 130, 0.08);
    color: var(--rose);
    transform: translateY(-1px);
}

.nav-link.active {
    background: var(--rose);
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ================================================================
   5. SISTEMA DE CARRITO (BARRA LATERAL)
   ================================================================ */
#cart-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 380px;
    height: 100vh;
    background-color: var(--blanco);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.cart-hidden {
    transform: translateX(100%);
}

#cart-sidebar.active {
    transform: translateX(0);
}

.cart-header {
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--borde-suave);
    background: #f9f9f9;
}

.cart-header h2 {
    font-size: 1.1rem;
    color: var(--morado);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.close-cart {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close-cart:hover {
    color: var(--morado);
}

.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f2f2f2;
    align-items: center;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f9f9f9;
    border-radius: 8px;
}

.item-details {
    flex-grow: 1;
}

.item-details h4 {
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--texto-dark);
}

.item-price {
    font-weight: 700;
    color: var(--morado);
    font-size: 0.95rem;
}

.cart-footer {
    padding: 25px;
    border-top: 1px solid var(--borde-suave);
    background: #ffffff;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cart-total-row span {
    font-size: 1rem;
    color: #777;
}

.cart-total-row strong {
    font-size: 1.3rem;
    color: var(--morado);
}

.btn-checkout {
    width: 100%;
    background-color: var(--verde);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(24, 199, 154, 0.2);
}

.btn-checkout:hover {
    background-color: #15b088;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(24, 199, 154, 0.3);
}

.btn-view-cart {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-view-cart:hover {
    text-decoration: underline;
}

/* ================================================================
   6. FOOTER PRINCIPAL
   ================================================================ */
.main-footer {
    background-color: var(--morado);
    color: var(--blanco);
    padding: 70px 20px 20px;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    margin-top: 50px;
}

.footer-container {
    max-width: 1250px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1.2fr;
    gap: 60px;
    padding: 0 20px;
}

.footer-col h4 {
    color: var(--blanco);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--verde);
}

.subscribe-form {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
}

.subscribe-form input {
    background: var(--blanco);
    border: none;
    padding: 12px 15px;
    color: var(--texto-dark);
    flex: 1;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-family: inherit;
}

.subscribe-form input::placeholder {
    color: #999;
}

.btn-subscribe {
    background-color: var(--verde);
    border: none;
    color: var(--blanco);
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    font-weight: 600;
    font-size: 0.9rem;
    transition: filter 0.3s ease;
}

.btn-subscribe:hover {
    filter: brightness(1.1);
}

.terms-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    margin-top: 15px;
}

.terms-label input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
}

.terms-label a {
    color: var(--verde);
    text-decoration: none;
}

.terms-label a:hover {
    text-decoration: underline;
}

.reclamaciones {
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    width: fit-content;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.reclamaciones:hover {
    background: rgba(255, 255, 255, 0.05);
}

.reclamaciones img {
    width: 60px;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    filter: none;
}

.reclamaciones span {
    font-size: 0.75rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.8);
}

.contact-item {
    margin-bottom: 25px;
}

.contact-item h4 {
    margin-bottom: 8px;
}

.contact-item p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0;
}

.social-icons {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.social-icons a {
    background: rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--blanco);
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

.footer-bottom {
    text-align: center;
    margin-top: 60px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* ================================================================
   7. MEDIA QUERIES (RESPONSIVE)
   ================================================================ */

/* FOOTER EN TABLETS (1024px) - Pasa de 4 a 2 columnas */
@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

/* HEADER Y DISEÑO EN MÓVILES (860px) */
@media (max-width: 860px) {

    /* HEADER: Filas y Columnas con CSS Grid */
    .header-inner {
        display: grid !important;
        grid-template-columns: auto 1fr auto;
        /* Hamburguesa | Logo | Carrito */
        grid-template-rows: auto auto;
        /* Fila 1: Logo/Iconos | Fila 2: Buscador */
        gap: 15px;
        padding: 15px 20px;
        align-items: center;
    }

    .hamburger-menu {
        display: block;
        grid-column: 1;
        grid-row: 1;
    }

    /* CORRECCIÓN DEL LOGO Y NOMBRE (CON SUBTÍTULO EN MÓVIL) */
    .brand {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .brand-logo {
        width: 42px;
        height: 42px;
    }

    .brand-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        line-height: 1.1;
    }

    .brand-name {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--rose);
        letter-spacing: 0.04em;
        margin: 0;
    }

    .brand-tagline {
        display: block;
        font-size: 0.65rem;
        color: var(--text-muted);
        margin-top: 2px;
        white-space: nowrap;
    }

    .header-actions {
        grid-column: 3;
        grid-row: 1;
    }

    .search-box {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: 100%;
    }

    /* DISEÑO TIPO APP PARA EL MENÚ (Se desliza desde la izquierda) */
    .header-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--blanco);
        flex-direction: column;
        justify-content: flex-start;
        padding: 70px 20px 20px;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.15);
        transition: left 0.3s ease;
        z-index: 2000;
    }

    .header-nav.active {
        left: 0;
    }

    .nav-link {
        width: 100%;
        text-align: left;
        padding: 18px 15px;
        border-bottom: 1px solid var(--borde-suave);
        border-radius: 0;
        font-size: 1.1rem;
    }

    .nav-link:hover {
        transform: none;
    }

    .close-menu {
        display: block;
        position: absolute;
        top: 10px;
        right: 20px;
        background: none;
        border: none;
        font-size: 3rem;
        color: var(--morado);
        cursor: pointer;
        line-height: 1;
    }
}

/* FOOTER Y AJUSTES FINALES EN CELULARES PEQUEÑOS (768px) */
@media (max-width: 768px) {

    /* El footer pasa a 1 sola columna centrada */
    .footer-container {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .subscribe-form {
        flex-direction: column;
        gap: 10px;
    }

    .subscribe-form input,
    .btn-subscribe {
        border-radius: 4px !important;
        width: 100%;
    }

    .reclamaciones {
        margin: 25px auto;
    }

    .social-icons {
        justify-content: center;
    }
}