/* --- Definición de Variables --- */
:root {
  --font-titles: 'Montserrat', 'Lato', sans-serif;
  --font-navigation: 'Lato', 'Montserrat', sans-serif;
  --font-body: 'Lato', sans-serif;
  --font-accent: 'Exo 2', sans-serif;
}

/* --- Estilos Generales --- */
body {
    margin: 0;
    font-family: var(--font-body);
    background-color: #f4f4f4;
    color: #333;
    padding-bottom: 80px; /* Espacio para el banner de cookies si es visible */
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 160px; /* Ajusta este valor si la altura de tu header cambia */
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Barra de Navegación Principal --- */
.main-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background-image: url('../img/header-background.png');
  background-repeat: no-repeat;
  background-size: 110% auto; 
  background-position: 60% center; 
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 40px;
    box-sizing: border-box;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.menu-button {
    background: none;
    border: none;
    color: #f6b945;
    font-size: 24px;
    cursor: pointer;
    margin-right: 45px;
    padding: 5px;
    z-index: 1002;
}

#logo {
    height: 120px;
    vertical-align: middle;
        filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.7)) 
            drop-shadow(3px 5px 10px rgba(0, 0, 0, 0.4));
}

.search-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-grow: 1;
    margin: 0 20px;
    position: relative;
}

.search-wrapper .search-container {
    max-width: 600px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.search-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    max-width: 600px;
    margin: 0 20px;
}

.search-container input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 20px 0 0 20px;
    font-size: 16px;
    outline: none;
    min-width: 150px;
    font-family: var(--font-body);
}

.search-container .search-button {
    padding: 10px 15px;
    background-color: #f6b945;
    border: 1px solid #f6b945;
    border-left: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    font-size: 16px;
    color: white;
}

.search-container .search-button:hover {
    background-color: #fed355;
}

/* === Estilo para eslogan en escritorio === */
.search-wrapper .header-tagline {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 18px);
    z-index: 1;
}

.header-tagline p {
    margin: 0;
    color: #f6b945;
    font-family: var(--font-navigation);
    font-weight: 700;
    font-size: 0.8rem; 
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

.nav-link {
    color: #f6b945;
    margin-left: 20px;
    font-size: 16px;
    display: flex;
    align-items: center;
    font-family: var(--font-navigation);
    font-weight: 700;
    gap: 8px;
}

.cart-link { position: relative; }

.cart-count {
    background-color: red;
    color: white;
    border-radius: 50%;
    position: absolute;
    top: -8px;
    right: -8px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
    display: none;
}

/* --- Menú Desplegable --- */
.main-nav {
    display: none;
    flex-direction: column;
    background-color: rgba(10, 25, 40, 0.95);
    position: absolute;
    left: 0;
    width: 300px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
    overflow-y: auto;
}
.main-nav.active { display: flex; transform: translateX(0); }
.main-nav a {
   color: white;
   padding: 15px 25px;
   text-decoration: none;
   border-bottom: 1px solid rgba(255, 255, 255, 0.1);
   font-size: 16px;
   font-family: var(--font-navigation);
}
.main-nav a:hover { background-color: rgba(255, 255, 255, 0.1); }
.main-nav a:last-child { border-bottom: none; }
.main-nav a.active-filter {
    background-color: rgba(246, 185, 69, 0.2);
    color: #f6b945;
}

/* --- Carrusel de Videos --- */
.video-carousel {
    width: 100%;
    height: calc(100vh - 150px);
    position: relative;
    overflow: hidden;
    background-color: #000;
}
.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}
.carousel-slide.active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}
.carousel-slide img, .carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: white;
    background-color: rgba(0,0,0,0.4);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
}
.carousel-control:hover {
    background-color: rgba(0,0,0,0.6);
    transform: translateY(-50%) scale(1.1);
}
.carousel-control.prev { left: 10px; }
.carousel-control.next { right: 10px; }

/* --- Cuadrícula de Productos --- */
.product-grid-container { max-width: 1200px; margin: 90px auto; padding: 0 20px; scroll-margin-top: 160px; }
.product-grid-container h2 { text-align: center; margin-bottom: 30px; font-size: 28px; color: #333; font-family: var(--font-titles); font-weight: 900; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.product-item { background-color: #fff; border: 1px solid #ddd; border-radius: 8px; text-align: center; padding: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.product-item:hover { transform: translateY(-5px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.product-image { width: 100%; height: 200px; object-fit: contain; margin-bottom: 10px; border-radius: 4px; }
.product-name { font-size: 18px; margin: 10px 0; color: #333; font-family: var(--font-titles); font-weight: 700; }
.product-price { font-size: 1.1em; color: #e47911; margin: 5px 0; font-family: var(--font-accent); font-weight: 800; }
.product-shipping { font-size: 0.9em; color: #007600; margin-top: 5px; font-family: var(--font-body); }
.product-item.hidden { display: none; }

/* --- Mensaje "No hay resultados" --- */
#no-results-message { text-align: center; padding: 40px 20px; background-color: #ffffff; border-radius: 8px; margin: 20px 0; border: 1px dashed #cccccc; }
#no-results-message p { font-size: 1.1em; color: #555; margin: 0 0 20px 0; }
#no-results-message button { background-color: #f6b945; color: white; border: none; border-radius: 5px; padding: 12px 25px; font-family: var(--font-navigation); font-size: 1em; font-weight: 700; cursor: pointer; transition: background-color 0.2s ease, transform 0.2s ease; }
#no-results-message button:hover { background-color: #fed355; transform: scale(1.02); }

/* --- Footer --- */
.main-footer { text-align: center; padding: 30px 20px; background-color: #333; color: #ccc; margin-top: 30px; }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px 30px; }
.footer-links a { color: #f6b945; font-family: var(--font-navigation); font-weight: 700; transition: color 0.2s; }
.footer-links a:hover { color: white; transform: none; opacity: 1; }
.footer-copyright p { margin: 0; font-size: 0.9em; }

/* --- Botón "Volver Arriba" --- */
#back-to-top-btn { position: fixed; bottom: 20px; right: 30px; background-color: #f6b945; color: white; border: none; border-radius: 50%; width: 50px; height: 50px; font-size: 22px; cursor: pointer; z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transform: translateY(20px); transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; }
#back-to-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* --- Botones de Acción --- */
.buy-button { display: inline-block; background-color: #f6b945; color: white; border: none; border-radius: 5px; padding: 15px 30px; font-family: var(--font-titles); font-size: 1.2em; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; transition: background-color 0.2s ease, transform 0.2s ease; }
.buy-button:hover { background-color: #fed355; transform: scale(1.02); }

/* --- Transiciones --- */
a, button { transition: all 0.25s ease-in-out; }
button:hover, a:hover { transform: scale(1.02); opacity: 0.9; }
button.carousel-control { transform-origin: center; }

/* --- Banner de Cookies --- */
.cookie-banner { position: fixed; bottom: -200px; left: 0; width: 100%; background-color: rgba(10, 25, 40, 0.97); color: white; padding: 20px; box-sizing: border-box; display: flex; justify-content: center; align-items: center; gap: 20px; z-index: 1050; transition: bottom 0.5s ease-in-out; flex-wrap: wrap; }
.cookie-banner.show { bottom: 0; }
.cookie-banner p { margin: 0; text-align: center; flex-grow: 1; }
.cookie-banner a { color: #f6b945; text-decoration: underline; }
.cookie-accept-btn { background-color: #f6b945; color: white; border: none; padding: 10px 25px; border-radius: 5px; cursor: pointer; font-weight: 700; font-family: var(--font-navigation); flex-shrink: 0; }
.cookie-accept-btn:hover { background-color: #fed355; }

/* --- Páginas Estáticas (Legales, Contacto) --- */
.static-page-container { max-width: 900px; margin: 160px auto 60px auto; padding: 40px; background-color: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); line-height: 1.7; }
.static-page-container h1 { font-family: var(--font-titles); font-weight: 900; color: #333; margin-bottom: 30px; border-bottom: 2px solid #f6b945; padding-bottom: 10px; }
.static-page-container h2 { font-family: var(--font-titles); font-weight: 700; color: #444; margin-top: 40px; margin-bottom: 15px; }
.static-page-container ul { padding-left: 20px; }
.static-page-container li { margin-bottom: 10px; }
.static-page-container strong { color: #333; }

/* --- Formulario de Contacto --- */
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.contact-form .form-group { display: flex; flex-direction: column; }
.contact-form label { margin-bottom: 8px; font-weight: 700; font-family: var(--font-navigation); color: #555; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form input[type="password"], .contact-form textarea { padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-family: var(--font-body); font-size: 1em; width: 100%; box-sizing: border-box; }
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form button { align-self: flex-start; }
.contact-info { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; }

/* --- Estilos para enlaces extra en formularios (Login/Registro) --- */
.form-extra-links {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #555;
}
.form-extra-links p {
    margin: 10px 0 0;
}
.form-extra-links a {
    color: #007bff;
    text-decoration: underline;
    font-weight: 700;
}
.form-extra-links a:hover {
    color: #0056b3;
    opacity: 1;
    transform: none;
}

/* --- Animación de Marquesina --- */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/*
=============================================================================
--- Media Queries (VERSIÓN LIMPIA Y UNIFICADA) ---
=============================================================================
*/

/* --- Para Tablets y dispositivos intermedios --- */
@media (max-width: 992px) {
    .header-content { padding: 15px 20px; }
    .search-container { margin: 0 10px; }
}

/* --- Para Tablets en vertical y móviles grandes --- */
@media (max-width: 768px) {
    /* -- 1. Reestructuración del Header -- */
    .header-content {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        row-gap: 15px;
    }
    .header-left, .header-right {
        width: auto; 
    }
    .search-wrapper {
        width: 100%; 
        order: 3;
        margin: 0;
        position: static;
    }
    #logo {
        height: 50px;
        margin-left: 15px;
        position: static;
        transform: none;
    }
    .menu-button {
        margin-right: 0;
    }
    .header-right .nav-link span:not(.cart-count) {
        display: none;
    }
    .main-header {
        background-position: 11% 73%; 
    }
   
    /* === Estilos del eslogan cuando está sobre el carrusel === */
    .video-carousel .header-tagline {
        position: absolute;
        top: 5px; /* <-- CAMBIO 1: Posición ajustada. */
        left: 0;
        right: 0;
        z-index: 5; 
        background-color: transparent; 
        overflow: hidden;
        pointer-events: none;
        padding: 8px 0;
    }

    .video-carousel .header-tagline p {
        display: flex;
        width: fit-content;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
        color: #f6b945;
    }

    .video-carousel .header-tagline p.is-animating {
        animation: marquee 25s linear infinite;
    }

    .video-carousel .header-tagline p span {
        /* Se eliminó el padding para que la unión sea perfecta */
    }

    /* -- 2. Ajustes de Layout y Espaciado -- */
    .video-carousel { 
        height: 40vh;
        margin-bottom: 0;
    }
    .product-grid-container {
        margin-top: 50px;
        margin-bottom: 50px;
    }
    .product-grid-container h2 {
        font-size: 24px;
    }
    .product-grid { 
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
        gap: 15px; 
    }
    .product-item { padding: 10px; }
    .product-name { font-size: 16px; }
    .product-price { font-size: 1em; }

    .search-wrapper .header-tagline {
        display: none; 
    }
}

/* --- Para móviles pequeños --- */
@media (max-width: 480px) {
    .search-container input[type=text] { font-size: 14px; }
    .search-container .search-button { padding: 10px 12px; font-size: 14px; }
    .main-nav { width: 250px; }
    .video-carousel { 
        height: 35vh;
        margin-bottom: 0;
    }
    .product-grid-container {
        margin-top: 30px;
        margin-bottom: 30px;
    }
    .product-grid-container h2 { font-size: 22px; }
    .product-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

/*
=============================================================================
--- Estilos para Formulario de Autenticación Personalizado ---
=============================================================================
*/

.auth-container {
    max-width: 450px;
    margin: 0 auto; /* Centrado dentro del static-page-container */
    padding: 20px;
}

.auth-container h2 {
    text-align: center;
    font-family: var(--font-titles);
    font-weight: 700;
    margin-bottom: 25px;
    color: #333;
}

.auth-container .form-group {
    margin-bottom: 20px;
}

.auth-container label {
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-navigation);
    color: #555;
}

.auth-container input[type="email"], 
.auth-container input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1em;
    box-sizing: border-box;
}

.auth-container .buy-button {
    display: block;
    width: 100%;
    margin-top: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-container .google-button {
    background-color: #4285F4;
    border-color: #4285F4;
}
.auth-container .google-button:hover {
    background-color: #357ae8;
    border-color: #357ae8;
}

.auth-container .separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #aaa;
    margin: 25px 0;
}

.auth-container .separator::before,
.auth-container .separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.auth-container .separator:not(:empty)::before {
    margin-right: 1em;
}

.auth-container .separator:not(:empty)::after {
    margin-left: 1em;
}

#auth-message {
    text-align: center;
    margin-top: 20px;
    font-weight: bold;
    min-height: 1.2em; /* Para evitar que el layout salte al aparecer el mensaje */
}


/* --- Estilos para Avatar y Menú Desplegable de Usuario --- */

.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--font-titles); /* Un color de fondo genérico */
    color: white;
    font-size: 1.2em;
    font-weight: 700;
    font-family: var(--font-titles);
    cursor: pointer;
    border: 2px solid #f6b945;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-user-select: none; /* Evita selección de texto en el avatar */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(246, 185, 69, 0.5);
}

.user-dropdown {
    position: absolute;
    top: 55px; /* Un poco por debajo del avatar */
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1010;
    width: 200px;
    overflow: hidden;
    display: none; /* Se mostrará con la clase .active */
    padding: 8px 0;
}

.user-dropdown.active {
    display: block;
}

.user-dropdown .user-info {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.user-dropdown .user-info .name {
    font-weight: 700;
    color: #333;
    display: block;
    word-break: break-all;
}

.user-dropdown .user-info .email {
    font-size: 0.9em;
    color: #777;
    display: block;
    word-break: break-all;
}

.user-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #333;
    font-size: 1em;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.user-dropdown a:hover {
    background-color: #f4f4f4;
    transform: none; /* Anular hover global */
    opacity: 1; /* Anular hover global */
}

.user-dropdown .dropdown-separator {
    height: 1px;
    background-color: #eee;
    margin: 8px 0;
}

.user-dropdown a#logout-button {
    color: #cc0000;
}

/* --- Mejoras de Usabilidad Adicionales --- */

/* Hacer que el logo en la cabecera reaccione al hover para indicar que es un enlace */
.main-header .logo-link {
    display: inline-block; /* Asegura que la transformación funcione correctamente */
    transition: transform 0.2s ease-in-out;
}

.main-header .logo-link:hover {
    transform: scale(1.03); /* Un ligero aumento de tamaño al pasar el ratón */
    opacity: 1; /* Sobrescribe cualquier otra regla de opacidad */
}

/* --- Sombra para el logo en páginas con fondo blanco --- */
.static-page-container #logo {
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.15));
}


/* ======================= INICIO DE LA MODIFICACIÓN ======================= */

/* 1. Definimos la animación de parpadeo */
@keyframes blink-animation {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2; /* Una opacidad baja es más suave que 0 */
  }
}

/* 2. Aplicamos la animación al texto "Próximamente" */
.blinking-text {
  animation: blink-animation 1.8s infinite; /* 1.8 segundos de duración, se repite infinitamente */
  font-weight: 700; /* Lo hacemos un poco más grueso */
  color: #007600; /* Usamos el color verde del "Envío Gratis" para que encaje */
  font-family: var(--font-body);
}

/* 3. Desactivamos los efectos de hover para la ficha estática */
.product-item--static {
    cursor: default; /* El cursor no cambia a una mano, indicando que no es clickeable */
}

.product-item--static:hover {
    transform: none; /* Evita que la ficha se levante */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Mantiene la sombra por defecto */
}

/* ======================== FIN DE LA MODIFICACIÓN ========================= */