:root {
    --color-bg: #0f0f13;
    --color-text-main: #ffffff;
    --color-text-muted: #a1a1aa;
    --font-heading: 'Impact', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-body);
    overflow-x: hidden;

    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../assets/images/FONDO_REESCALADO.webp');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    min-height: 100vh;

    border-left: 2px solid white;
    border-right: 2px solid white;
    border-top: none;
    border-bottom: none;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    border-top: 2px solid white;
    z-index: 9999;
    pointer-events: none;
}

/* --- HERO --- */
.brand-hero {
    width: 100%;
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding-top: 22px;
}

.huge-logo {
    width: 90%;
    max-width: 800px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0px 10px 30px rgba(0, 0, 0, 0.6));
}

/* --- CENTINELA --- */
#sticky-sentinel {
    position: absolute;
    top: 70vh;
    height: 1px;
    width: 100%;
    visibility: hidden;
    pointer-events: none;
}

/* --- NAVBAR --- */
.navbar {
    display: grid;
    grid-template-columns: 140px 1fr 140px;
    height: 60px;
    overflow: hidden;

    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;

    border-top: 2px solid white;
    border-bottom: 2px solid white;
    border-left: none;
    border-right: none;

    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../assets/images/FONDO_REESCALADO.webp');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    transition: all 0.3s ease;
}

.nav-item {
    display: flex;
    align-items: center;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.nav-item.left {
    justify-content: center;
    padding-left: 0;
}

.nav-item.right {
    justify-content: flex-end;
    padding-right: 20px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
}

.nav-btn:active {
    opacity: 0.7;
}

/* --- CENTRO DINÁMICO --- */
.nav-center {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    border-left: 2px solid white;
    border-right: 2px solid white;
    overflow: hidden;
    position: relative;
}

/* MARQUEE */
.marquee-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 1;
    transform: translateY(0);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.marquee-content {
    display: flex;
    width: fit-content;
    min-width: 100%;
    animation: marquee 32s linear infinite;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.marquee-content span {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    flex-shrink: 0;
    padding-right: 2rem;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* LOGO MINI */
.logo-mini {
    height: 40px;
    width: auto;
    object-fit: contain;
    position: relative;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* NEW: Container for absolute centering in Home/Product/Return */
.logo-link {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reset logo-mini positioning when inside logo-link */
.logo-link .logo-mini {
    left: auto;
    transform: translateY(30px);
}

/* Override for stuck state inside logo-link */
.navbar.stuck .logo-link .logo-mini {
    transform: translateY(0);
}

/* ESTADOS NAVBAR STUCK */
.navbar.stuck .marquee-container {
    opacity: 0;
    transform: translateY(-30px);
    pointer-events: none;
}

.navbar.stuck .logo-mini {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* --- MAIN CONTENT --- */
.main-content {
    padding-bottom: 80px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
}

.product-card {
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: rgba(0, 0, 0, 0.2);
    border-right: 2px solid white;
    border-bottom: 2px solid white;
}

.product-card:nth-child(3n) {
    border-right: none;
}

/* Contenedor de la imagen */
.image-container {
    width: 100%;
    aspect-ratio: 4/5;
    overflow: hidden;
    border-bottom: 2px solid white;

    /* AÑADIDO: Para centrar la imagen si sobra espacio */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.2);
    /* Fondo sutil por si la imagen no llena todo */
}

/* La imagen en sí */
.image-container img {
    width: 100%;
    height: 100%;

    /* CAMBIO CLAVE: 'contain' para que se vea entera sin zoom */
    object-fit: contain;

    /* ESPACIO: Ajusta este padding (20px, 30px...) para hacerla más pequeña */
    padding: 20px;

    transition: transform 0.4s ease;
}

/* Efecto Hover (opcional: un zoom suave al pasar el ratón) */
.product-card:hover .image-container img {
    transform: scale(1.1);
    /* Un poco de zoom al pasar el mouse queda bien */
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    flex-grow: 1;
}

.product-price {
    font-family: var(--font-body);
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
}

.btn-add {
    width: 100%;
    padding: 1rem;
    background: transparent;
    color: white;
    border: none;
    border-top: 2px solid white;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add:hover {
    background: white;
    color: black;
}

.btn-add:active {
    transform: scale(0.98);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    width: 100%;
    flex-grow: 1;
}

/* --- FOOTER --- */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: black;
    color: white;

    border-top: 2px solid white;
    border-bottom: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid white;

    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 2000;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* --- OVERLAYS --- */
.menu-overlay,
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow: hidden;
}

.menu-overlay::before,
.cart-overlay::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('../assets/images/FONDO_REESCALADO.webp');
    background-size: cover;
    background-position: center;
    filter: blur(15px);
    z-index: -1;
}

.menu-overlay.active,
.cart-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.close-btn,
.close-cart-btn {
    position: absolute;
    top: 0;
    height: 60px;
    padding: 0 20px;
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    cursor: pointer;
    text-transform: uppercase;
    z-index: 3001;
    transition: opacity 0.2s ease;
}

.close-btn {
    left: 0;
}

.close-cart-btn {
    right: 0;
}

.close-btn:hover,
.close-cart-btn:hover {
    color: var(--color-text-muted);
}

.close-btn:active,
.close-cart-btn:active {
    opacity: 0.7;
}

/* MENU CONTENT */
.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.menu-link {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: transparent;
    -webkit-text-stroke: 2px white;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
}

.menu-link:hover {
    color: white;
    -webkit-text-stroke: 0px;
    transform: scale(1.1);
}

.menu-link:active {
    transform: scale(1.05);
}

/* CART CONTENT */
.cart-content {
    width: 100%;
    max-width: 600px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    border: 2px solid white;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
}

.cart-header {
    font-family: var(--font-heading);
    font-size: 2rem;
    border-bottom: 2px solid white;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.cart-items {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.cart-footer {
    border-top: 2px solid white;
    padding-top: 20px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: white;
    color: black;
    border: none;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s ease;
}

.checkout-btn:hover {
    background: #ccc;
}

.checkout-btn:active {
    transform: scale(0.98);
}

/* =========================================
   MEDIA QUERIES - RESPONSIVE MÓVIL
   ========================================= */

/* Tablets grandes y pantallas medianas */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-card:nth-child(3n) {
        border-right: 2px solid white;
    }

    .product-card:nth-child(2n) {
        border-right: none;
    }

    .menu-link {
        font-size: 3.5rem;
    }
}

/* Tablets - Mantener imagen horizontal */
@media (max-width: 900px) and (min-width: 769px) {
    .navbar {
        /* Navbar transparente en tablets */
        background-image: none;
        background: rgba(0, 0, 0, 0.7);
    }

    .nav-item {
        background: transparent;
    }

    .marquee-content {
        animation: marquee 16s linear infinite;
    }

    .marquee-content span {
        font-size: 1rem;
    }

    .brand-hero {
        min-height: 50vh;
        padding: 15px;
    }

    #sticky-sentinel {
        top: 50vh;
    }

    .huge-logo {
        width: 85%;
    }

    .menu-link {
        font-size: 3rem;
    }
}

/* Móviles - Usar imagen vertical */
@media (max-width: 768px) {

    /* Crear fondo fijo con pseudo-elemento para evitar pixelación Safari */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../assets/images/FONDO_REESCALADO_VERTICAL.webp');
        background-size: cover;
        background-position: top center;
        background-repeat: no-repeat;
        z-index: -1;
    }

    body {
        background-image: none;
    }

    .navbar {
        background-image: none;
        background: rgba(0, 0, 0, 0.7);
    }

    .nav-item {
        background: transparent;
    }

    .menu-overlay::before,
    .cart-overlay::before {
        background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('../assets/images/FONDO_REESCALADO_VERTICAL.webp');
        background-attachment: scroll;
        background-size: cover;
    }

    /* Móviles medianos */
    @media (max-width: 768px) {

        /* Navbar más compacta */
        .navbar {
            grid-template-columns: 100px 1fr 100px;
            height: 50px;
        }

        .nav-btn {
            font-size: 1.4rem;
        }

        .nav-item.right {
            padding-right: 15px;
        }

        .logo-mini {
            height: 32px;
        }

        /* Grid de productos a 1 columna */
        .product-grid {
            grid-template-columns: 1fr;
        }

        .product-card {
            border-right: none;
        }

        .product-card:nth-child(2n),
        .product-card:nth-child(3n) {
            border-right: none;
        }

        /* Productos más compactos */
        .product-info {
            padding: 1rem;
        }

        .product-price {
            font-size: 1.1rem;
        }

        .btn-add {
            padding: 0.8rem;
            font-size: 1.1rem;
        }

        /* Footer más pequeño */
        .footer {
            height: 50px;
            font-size: 0.7rem;
            padding: 0 15px;
        }

        .main-content {
            padding-bottom: 70px;
        }

        /* Menu overlay */
        .menu-link {
            font-size: 2.5rem;
            -webkit-text-stroke: 1.5px white;
        }

        .menu-content {
            gap: 1.5rem;
        }

        /* Cart overlay */
        .cart-content {
            max-width: 90%;
            padding: 15px;
            height: 85vh;
        }

        .cart-header {
            font-size: 1.6rem;
            padding-bottom: 8px;
            margin-bottom: 15px;
        }

        .cart-items {
            font-size: 1.2rem;
        }

        .cart-total {
            font-size: 1.3rem;
            margin-bottom: 15px;
        }

        .checkout-btn {
            padding: 12px;
            font-size: 1.3rem;
        }

        .close-btn,
        .close-cart-btn {
            font-size: 1.4rem;
            height: 50px;
            padding: 0 15px;
        }
    }

    /* Móviles pequeños */
    @media (max-width: 480px) {

        /* Navbar ultra compacta */
        .navbar {
            grid-template-columns: 80px 1fr 80px;
            height: 45px;
        }

        .nav-btn {
            font-size: 1.2rem;
        }

        .nav-item.right {
            padding-right: 10px;
        }

        .marquee-content span {
            font-size: 0.85rem;
            letter-spacing: 1px;
            padding-right: 1.5rem;
        }

        .logo-mini {
            height: 28px;
        }

        /* Hero más compacto */
        .brand-hero {
            min-height: 40vh;
            padding: 10px;
        }

        #sticky-sentinel {
            top: 40vh;
        }

        .huge-logo {
            width: 90%;
        }

        /* Productos aún más compactos */
        .product-info {
            padding: 0.8rem;
            gap: 0.3rem;
        }

        .product-price {
            font-size: 1rem;
        }

        .btn-add {
            padding: 0.7rem;
            font-size: 1rem;
        }

        /* Footer mini */
        .footer {
            height: 45px;
            font-size: 0.6rem;
            padding: 0 10px;
            flex-wrap: wrap;
            gap: 5px;
        }

        .footer-item-trademark,
        .footer-item-contact {
            font-size: 0.65rem;
        }

        .main-content {
            padding-bottom: 60px;
        }

        /* Menu más compacto */
        .menu-link {
            font-size: 2rem;
            -webkit-text-stroke: 1px white;
        }

        .menu-content {
            gap: 1.2rem;
        }

        /* Cart más compacto */
        .cart-content {
            max-width: 95%;
            padding: 12px;
            height: 90vh;
        }

        .cart-header {
            font-size: 1.4rem;
            padding-bottom: 6px;
            margin-bottom: 12px;
        }

        .cart-items {
            font-size: 1rem;
        }

        .cart-total {
            font-size: 1.1rem;
            margin-bottom: 12px;
        }

        .checkout-btn {
            padding: 10px;
            font-size: 1.1rem;
        }

        .close-btn,
        .close-cart-btn {
            font-size: 1.2rem;
            height: 45px;
            padding: 0 10px;
        }
    }

    /* Mejoras táctiles para móvil */
    @media (hover: none) and (pointer: coarse) {

        /* Aumentar área táctil de botones */
        .nav-btn,
        .btn-add,
        .close-btn,
        .close-cart-btn,
        .checkout-btn,
        .menu-link {
            min-height: 44px;
            min-width: 44px;
        }

        /* Eliminar hover effects en móvil */
        .product-card:hover .image-container img {
            transform: scale(1);
        }

        /* Feedback táctil */
        .product-card:active .image-container img {
            transform: scale(0.98);
        }
    }
}