@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

/* 
 * CSS - Majois E-commerce 
 * Hitos de Interfaz Globales
 */

:root {
    /* Colores Corporativos MAJOIS (Extraídos de la imagen de referencia) */
    --color-azul-oscuro: #005b8e;
    /* Menú, botones "Agregar al Carrito" y logo */
    --color-celeste: #7cb5db;
    /* Detalles del copo de nieve y logo */
    --color-rosa-coral: #d84b7a;
    /* Barra superior "BIENVENIDOS" */
    --color-amarillo: #ffd500;
    /* Ola amarilla en el banner central */
    --color-rojo-onda: #e12028;
    /* Ola roja en el banner central */

    /* Mapeo de Colores de Interfaz UI */
    --color-primary: var(--color-azul-oscuro);
    --color-secondary: var(--color-rosa-coral);
    --color-accent: var(--color-amarillo);

    --color-bg: #fefefe;
    /* Fondo general ultra claro */
    --color-surface: #ffffff;
    /* Tarjetas y paneles en blanco puro */
    --color-text: #2c3e50;
    /* Texto oscuro y legible */
    --color-text-muted: #7f8c8d;
    --color-border: #e2e8f0;

    /* Tipografía Moderna */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset de Estilos Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* Jerarquía Tipográfica Básica */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-primary);
    font-weight: 700;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--color-secondary);
}

/* ========================================================================= */
/*                              HITO 2: HEADER                               */
/* ========================================================================= */

/* Sistema de Contenedor Responsivo (Breakpoints Escalonados) */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    /* Margen vital para la lectura en celulares y resoluciones no estándar */
}

/* Tablets grandes (modo paisaje) y Notebooks chicas */
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

/* Notebooks / Laptops estandar (Pantallas ~1366px) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Monitores Desktop Full HD (1920p) o QHD (2K/4K) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

.site-header {
    background-color: var(--color-surface);
}

/* CONTENEDOR STICKY MÁGICO */
#sticky-wrapper {
    position: sticky;
    top: 0;
    z-index: 9999;
    background-color: var(--color-surface);
    transition: box-shadow 0.3s ease;
}

#sticky-wrapper.scrolled {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* 1. Barra Superior (Rosa/Coral) */
.top-bar {
    background-color: var(--color-secondary);
    color: var(--color-surface);
    text-align: center;
    padding: 12px 0;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* 2. Sección Central (Logo, Buscador, Acciones) */
.middle-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
    transition: padding 0.3s ease;
}

#sticky-wrapper.scrolled .middle-bar {
    padding-top: 10px;
    padding-bottom: 10px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.header-logo img {
    height: 50px;
    width: auto;
    transition: height 0.3s ease;
}

#sticky-wrapper.scrolled .header-logo img {
    height: 38px;
}

.header-logo .brand-text {
    color: var(--color-primary);
    font-size: 1rem;
    font-weight: 500;
}

.logo-and-menu {
    display: flex;
    align-items: center;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
    cursor: pointer;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--color-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    max-width: 700px;
    margin: 0 40px;
}

.header-search label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
}

.header-search input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--color-text);
    border-radius: 2px;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
}

.header-search input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.header-actions {
    display: flex;
    gap: 25px;
}

.header-actions a {
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
}

.header-actions a:hover {
    color: var(--color-primary);
}

/* 3. Menú Inferior (Bloques Azules) */
.main-nav {
    padding-bottom: 25px;
    transition: padding 0.3s ease;
}

#sticky-wrapper.scrolled .main-nav {
    padding-bottom: 15px;
    /* Menos margen al flotar para no comer pantalla útil */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.main-nav a {
    background-color: var(--color-primary);
    color: var(--color-surface);
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 0;
    text-align: center;
    flex: 1;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.main-nav a:hover,
.nav-dropdown:hover>a {
    background-color: #00456b;
    /* Un tono un poco más oscuro que el primary */
    color: var(--color-surface);
}

/* 4. Dropdown Dinámico para Marcas */
.nav-dropdown {
    flex: 1;
    position: relative;
    display: flex;
}

.nav-dropdown>a {
    width: 100%;
    box-sizing: border-box;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--color-surface);
    min-width: 100%;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    top: 100%;
    left: 0;
    flex-direction: column;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-surface);
}

.dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: var(--color-surface);
}

.dropdown-content::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 10px;
}

.nav-dropdown:hover .dropdown-content {
    display: flex;
}

.dropdown-content a {
    color: var(--color-text) !important;
    padding: 12px 16px !important;
    text-decoration: none;
    display: block;
    background-color: transparent !important;
    text-align: left !important;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--color-primary) !important;
    color: var(--color-surface) !important;
}

/* ========================================================================= */
/*                              HITO 5: FOOTER                               */
/* ========================================================================= */

.site-footer {
    background-color: var(--color-azul-oscuro);
    color: #ffffff;
    padding-top: 50px;
    margin-top: 50px;
    /* Separación del contenido anterior */
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 40px;
}

.footer-col {
    flex: 1;
}

.footer-icon {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.footer-icon svg {
    color: var(--color-accent);
    /* Mantenemos el amarillo como destaque */
    width: 35px;
    height: 35px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.2s ease, color 0.2s ease;
}

.footer-icon svg:hover {
    transform: scale(1.1);
    color: #ffffff;
}

.footer-col p {
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.footer-col p strong {
    font-weight: 600;
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    /* Línea sutil */
    padding: 20px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-weight: 500;
}



/* ========================================================================= */
/*                              HITO 20: FICHA DE PRODUCTO                   */
/* ========================================================================= */
.product-detail-section {
    display: flex;
    gap: 60px;
    padding: 70px 0;
    align-items: flex-start;
}

.product-gallery {
    flex: 1;
    /* 50% */
    background-color: transparent;
    border-radius: 12px;
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* Sombra elegante */
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-gallery img {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    mix-blend-mode: multiply;
    /* Funciona mágico para eliminar fondos blancos suaves en JPEG */
}

.product-info {
    flex: 1;
    /* 50% */
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.product-brand {
    color: var(--color-secondary);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    display: table;
    transition: border-color 0.3s ease;
}

.product-brand:hover {
    border-bottom: 2px solid var(--color-secondary);
}

.product-title {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin: 0;
    line-height: 1.15;
    font-weight: 800;
}

.product-price {
    font-size: 2.2rem;
    color: var(--color-text);
    margin: 0;
    font-weight: 700;
    background-color: rgba(234, 114, 140, 0.08);
    /* Coral transparente */
    padding: 12px 20px;
    border-radius: 8px;
    display: inline-block;
    border-left: 5px solid var(--color-secondary);
}

.product-description p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #444;
}

.product-features {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.product-features li {
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.add-to-cart-box {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: #fcfcfc;
    padding: 35px;
    border-radius: 12px;
    border: 1px solid #eaeaea;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.03);
}

.qty-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qty-selector label {
    font-size: 1.05rem;
    font-weight: 600;
    color: #666;
}

.qty-selector input {
    width: 120px;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
    font-weight: 700;
    transition: border-color 0.3s ease;
}

.qty-selector input:focus {
    border-color: var(--color-primary);
}

.btn-add-cart-large {
    background-color: var(--color-primary);
    color: #ffffff;
    border: none;
    padding: 22px 24px;
    font-size: 1.3rem;
    font-weight: 800;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-add-cart-large:hover {
    background-color: var(--color-secondary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(234, 114, 140, 0.3);
}

/* ========================================================================= */
/*                              HITO 21: LA VISTA DEL CARRITO                */
/* ========================================================================= */
.cart-page {
    padding: 60px 0;
    min-height: 60vh;
}

.cart-layout {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    align-items: flex-start;
}

.cart-items {
    flex: 7;
    /* Consume el 70% del ancho (Visualmente idéntico al ZigZag) */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* Sombra difusa suave */
    padding: 30px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-summary {
    flex: 3;
    /* Consume el 30% faltante */
    background: #fdfdfd;
    border-radius: 12px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.08);
    /* Jerarquización vertical para Checkout */
    padding: 35px;
    border: 1px solid #eaeaea;
    position: sticky;
    top: 100px;
    /* Al hacer scroll viaja junto a la Ficha */
}

.cart-item-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-item-img {
    width: 90px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eeeff0;
    padding: 5px;
}

.cart-item-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    /* Rompe los fondos JPEG agresivos de los artículos */
}

.cart-item-details {
    flex: 2;
}

.cart-item-title {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    color: var(--color-primary);
    font-weight: 700;
}

.cart-item-price {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.btn-qty {
    background: #f1f1f1;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    color: #444;
    transition: background 0.2s;
}

.btn-qty:hover {
    background: #e2e2e2;
}

.input-qty {
    width: 45px;
    text-align: center;
    border: none;
    font-size: 1.05rem;
    font-weight: 700;
    -moz-appearance: textfield;
    /* Estética pulcra y unificada */
    appearance: textfield;
}

.cart-item-subtotal {
    flex: 1;
    text-align: right;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-text);
}

.cart-item-remove {
    margin-left: 20px;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--color-secondary);
    /* Usa el acento de peligro de tu paleta base */
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: transform 0.2s;
}

.btn-remove:hover {
    transform: scale(1.3);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.15rem;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--color-primary);
}

/* Responsividad extra por si acaso */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    /* Adaptación Visual Móvil para Header (Hito 2) */
    .top-bar {
        font-size: 0.95rem;
        padding: 8px 0;
    }

    .middle-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px 10px;
    }

    .logo-and-menu {
        width: 100%;
        justify-content: space-between;
    }

    .hamburger-menu {
        display: flex;
    }

    /* Transformación Hamburguesa a X */
    .hamburger-menu.active span:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg);
    }

    .hamburger-menu.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active span:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg);
    }

    .main-nav {
        display: none;
        width: 100%;
        padding-bottom: 0px;
    }

    .main-nav.active-mobile {
        display: block;
        animation: slideDownNav 0.3s ease forwards;
        margin-top: 15px;
    }

    .search-label-desktop {
        display: none !important;
    }

    .header-logo img {
        height: 40px;
    }

    .header-search {
        margin: 0;
        max-width: 100%;
        width: 100%;
    }

    .header-actions {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .nav-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .nav-dropdown {
        width: 100%;
    }

    .main-nav a {
        padding: 10px 0;
        font-size: 0.9rem;
        border-radius: 4px;
        width: 100%;
    }

    .site-footer {
        margin-top: 0;
        padding-top: 10px;
    }

    .footer-top {
        flex-direction: column;
        gap: 30px;
    }
    .footer-col {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        text-align: left !important;
        gap: 15px;
    }
    .footer-col p {
        margin-bottom: 5px;
    }
    .footer-col p:last-child {
        margin-bottom: 0;
    }
    .footer-icon {
        margin-bottom: 0;
    }
    .footer-col p strong {
        display: none;
    }



    .product-detail-section {
        flex-direction: column;
        padding: 40px 0;
        gap: 30px;
    }

    .add-to-cart-box {
        padding: 25px 20px;
    }

    /* Adaptación Visual Móvil para Carrito (Hito 21) */
    .cart-layout {
        flex-direction: column;
        gap: 20px;
    }

    .cart-items,
    .cart-summary {
        width: 100%;
        padding: 20px;
        box-sizing: border-box;
    }

    .cart-summary {
        position: static;
        /* Pierde el sticky porque no hay lateral */
    }

    .cart-item-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        position: relative;
        padding-top: 35px;
        /* Aire para el botón de eliminar flotante */
    }

    .cart-item-img {
        width: 100%;
        max-width: 150px;
        margin-bottom: 10px;
        border: none;
    }

    .cart-item-remove {
        position: absolute;
        top: 10px;
        right: 0;
        margin: 0;
    }

    .cart-item-subtotal {
        text-align: center;
        width: 100%;
        margin-top: 15px;
        font-size: 1.5rem;
    }

    .cart-item-qty {
        justify-content: center;
    }
}

@keyframes slideDownNav {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}