/* =========================================== */
/* VARIABLES GLOBALES DE COLORES Y ESTILOS */
/* =========================================== */
:root {
    --rojo: #EE1C25;
    --verde: #36B449;
    --azul: #0E76BB;
    --azul-oscuro: #1A0846;
    --dorado: #D4AF37;
    --beige: #F5F0E6;
    --gris-claro: #f5f5f5;
    --azul-oscuro-rgb: 26, 8, 70;
    --rojo-rgb: 238, 28, 37;
}

/* =========================================== */
/* ESTILOS GENERALES */
/* =========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--azul-oscuro);
    background: var(--gris-claro);
    background-image: url('img/textura-agave-body.webp');
    background-blend-mode: overlay;
    background-attachment: fixed;
}

/* =========================================== */
/* BARRA DE NAVEGACIÓN - MOVIDA HACIA ARRIBA */
/* =========================================== */
.navbar {
    background: var(--azul-oscuro);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 5%; /* Padding reducido para mover hacia arriba */
    position: fixed;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.2);
    border-bottom: 2px solid var(--dorado);
    top: 0; /* Aseguramos que esté pegada arriba */
}

.logo img {
    height: 60px; /* Altura reducida para mover hacia arriba */
    transition: transform 0.3s;
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links li a {
    color: var(--beige);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
    border-radius: 5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.nav-links li a:hover {
    color: var(--dorado);
    background: rgba(255, 255, 255, 0.1);
}

.cart-btn {
    background: var(--rojo);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s;
    font-weight: 600;
}

.cart-btn:hover {
    background: #C8161D;
    transform: translateY(-2px);
}

/* =========================================== */
/* HERO SECTION - VIDEO DE FONDO */
/* =========================================== */
.hero {
    position: relative;
    height: 100vh;
    margin-top: 60px;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        rgba(var(--azul-oscuro-rgb), 0.6) 0%,
        rgba(var(--rojo-rgb), 0.3) 100%
    );
    z-index: 1;
}

.hero video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    min-height: 480px;
    background: var(--azul-oscuro);
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--beige);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px) brightness(0.5);
    padding: 2rem 3rem;
    border-radius: 15px;
    z-index: 2;
    width: 90%;
    max-width: 800px;
    border: 2px solid var(--azul-oscuro);
    background: linear-gradient(
        45deg,
        rgba(var(--azul-oscuro-rgb), 0.6) 0%,
        rgba(var(--rojo-rgb), 0.3) 100%
    );
}

/* Título principal */
.hero-content h1 {
    font-size: 3.0rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
    animation: textReveal 1.5s ease-out forwards;
    font-family: 'Georgia', serif;
    letter-spacing: 2px;
/*    white-space: nowrap;*/
    overflow: visible;
    padding: 0 20px;
    line-height: 1.1;
    text-transform: uppercase;
    font-weight: 700;
    position: relative;
}

.hero-content h1::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--dorado);
    border-radius: 2px;
}

/* CAMBIO IMPORTANTE: Estilo para el slogan */
.hero-content .slogan {
    font-size: 1.8rem;
    color: var(--dorado);
    font-weight: 600;
    letter-spacing: 1px;
    margin: 1.5rem 0 0.8rem;
    animation: textReveal 1.5s ease-out 0.4s forwards;
    opacity: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    position: relative;
    display: inline-block;
    padding: 0 10px;
    font-style: italic;
}

.hero-content .slogan::before,
.hero-content .slogan::after {
    content: "✦";
    color: var(--dorado);
    margin: 0 10px;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* CAMBIO IMPORTANTE: Estilo para el subtítulo */
.hero-content .subtitulo {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 300;
    letter-spacing: 0.5px;
    max-width: 80%;
    margin: 0 auto;
    animation: textReveal 1.5s ease-out 0.5s forwards;
    opacity: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    padding: 15px 0;
    position: relative;
    line-height: 1.8;
}

.hero-content .subtitulo::before,
.hero-content .subtitulo::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.hero-content .subtitulo::before {
    top: 0;
}

.hero-content .subtitulo::after {
    bottom: 0;
}

/* =========================================== */
/* ESTILOS GENERALES DE SECCIONES */
/* =========================================== */
.section {
    scroll-margin-top: 100px;
    padding: 6rem 5% 5rem;
    position: relative;
    max-width: 1200px;
    margin: 0 auto; /* Centrado y mismo ancho para todas */
}

.section h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--azul-oscuro);
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.section h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--verde);
}

/* Iconos en títulos de secciones */
.section h2 i {
    background: var(--azul-oscuro);
    color: var(--dorado);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* =========================================== */
/* SECCIÓN DE PRODUCTOS */
/* =========================================== */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0;
}

.producto-card {
    background: var(--beige);
    border-radius: 15px;
    padding: 1.2rem; /* Reducir padding */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    height: 100%; /* Asegurar misma altura */
    display: flex;
    flex-direction: column;    
}

.producto-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.producto-card img {
    width: 100%;
    height: 180px; /* Reducir altura de imagen */
    object-fit: contain;
    background: #f8f8f8;
    border-radius: 10px;
    padding: 8px; /* Reducir padding */
    margin-bottom: 0.8rem; /* Reducir margen */
}

.producto-card h3 {
    color: var(--azul-oscuro);
    font-size: 1.1rem; /* Reducir tamaño de fuente */
    margin-bottom: 0.4rem;
    min-height: 50px; /* Reducir altura mínima */
}

.producto-card p {
    color: #555;
    margin-bottom: 0.8rem;
    font-size: 0.85rem; /* Reducir tamaño de fuente */
    min-height: 60px; /* Reducir altura mínima */
    flex-grow: 1; /* Asegurar que ocupe espacio disponible */
}

.precio {
    color: var(--rojo);
    font-size: 1.2rem; /* Reducir tamaño de fuente */
    font-weight: bold;
    margin: 0.8rem 0; /* Reducir margen */
    display: block;
}

.producto-card button {
    background: var(--azul-oscuro);
    color: white;
    border: none;
    padding: 0.6rem 1rem; /* Reducir padding */
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.8rem; /* Reducir tamaño de fuente */
    margin-top: auto; /* Empujar el botón hacia abajo */
}

.producto-card button:hover {
    background: var(--verde);
    color: var(--azul-oscuro);
}

/* =========================================== */
/* SECCIÓN DE PROMOCIONES */
/* =========================================== */
.promociones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.promo-card {
    background: var(--beige);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
}

.promo-card:hover {
    transform: scale(1.02);
}

.promo-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.promo-content {
    padding: 1.5rem;
    text-align: center;
}

.promo-content h3 {
    color: var(--azul-oscuro);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.precio-antiguo {
    text-decoration: line-through;
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.precio-promo {
    color: var(--rojo);
    font-size: 1.6rem;
    font-weight: bold;
    display: block;
    margin: 0.5rem 0;
}

/* Etiqueta de promoción */
.promo-card::before {
    content: "OFERTA";
    position: absolute;
    top: 15px;
    right: -30px;
    background: var(--rojo);
    color: white;
    padding: 5px 35px;
    font-size: 0.8rem;
    font-weight: bold;
    transform: rotate(45deg);
    z-index: 10;
    letter-spacing: 1px;
}

/* =========================================== */
/* SECCIÓN NOSOTROS - MISMO ANCHO QUE LAS DEMÁS */
/* =========================================== */
#nosotros.section {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 6rem 5%;
    position: relative;
    overflow: hidden;
}

/* Fondo de tapiz agregado */
#nosotros.section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img/textura-agave-nosotros.jpg');
    background-size: cover;
    opacity: 0.03;
    z-index: 0;
}

#nosotros h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--azul-oscuro);
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

#nosotros h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--verde);
}

#nosotros h2 i {
    background: var(--azul-oscuro);
    color: var(--dorado);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.nosotros-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: flex-start;
    padding: 1.5rem;
}

.nosotros-texto {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    text-align: justify;
    padding-right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.nosotros-texto p {
    margin-bottom: 0;
    position: relative;
}

.historia-intro {
    font-style: italic;
    padding: 2rem;
    border-left: 3px solid var(--dorado);
    background: rgba(245, 240, 230, 0.5);
    position: relative;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.historia-intro i:first-child {
    position: absolute;
    top: 15px;
    left: 15px;
    opacity: 0.3;
    font-size: 1.2rem;
}

.historia-intro i:last-child {
    position: absolute;
    bottom: 15px;
    right: 15px;
    opacity: 0.3;
    font-size: 1.2rem;
}

.historia-destacado {
    background: rgba(212, 175, 55, 0.1);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--dorado);
    font-weight: 600;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.historia-destacado i:first-child {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--dorado);
}

.historia-destacado i:last-child {
    position: absolute;
    bottom: 15px;
    right: 15px;
    color: var(--dorado);
}

.historia-cierre {
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--azul-oscuro);
    background: rgba(26, 8, 70, 0.05);
    padding: 1.8rem;
    border-radius: 8px;
    border-top: 2px solid var(--dorado);
    text-align: center;
    margin-top: 1rem;
}

.nosotros-galeria {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 0;
}

.galeria-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.galeria-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.galeria-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.galeria-desc {
    padding: 1.2rem;
    background: rgba(26, 8, 70, 0.85);
    color: white;
}

.galeria-desc h4 {
    color: var(--dorado);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.galeria-desc p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
}

/* =========================================== */
/* SECCIÓN MISIÓN Y VISIÓN */
/* =========================================== */
.mision-vision {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: linear-gradient(135deg, var(--azul-oscuro) 0%, #2a1b5e 100%);
    color: var(--beige);
    padding: 4rem 5%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.mision-vision::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img/pattern-agave.png');
    opacity: 0.05;
    z-index: 0;
}

.mision, .vision {
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s;
    backdrop-filter: blur(5px);
}

.mision:hover, .vision:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.15);
}

.mision h3, .vision h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--dorado);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.mision h3::after, .vision h3::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--dorado);
}

.mision h3 i, .vision h3 i {
    font-size: 2rem;
}

.mision ul, .vision ul {
    list-style: none;
    text-align: left;
    margin-top: 1.5rem;
}

.mision li, .vision li {
    padding: 0.8rem 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mision li:last-child, .vision li:last-child {
    border-bottom: none;
}

.mision li i, .vision li i {
    color: var(--dorado);
    font-size: 1.3rem;
    min-width: 25px;
    margin-top: 5px;
}

/* =========================================== */
/* SECCIÓN DE CONTACTO */
/* =========================================== */
.contacto-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.contacto-form {
    background: var(--beige);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.contacto-form input,
.contacto-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border 0.3s;
}

.contacto-form input:focus,
.contacto-form textarea:focus {
    border-color: var(--azul);
    outline: none;
    box-shadow: 0 0 0 2px rgba(14, 118, 187, 0.2);
}

.contacto-form button {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    background: var(--azul-oscuro);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.contacto-form button:hover {
    background: var(--verde);
    color: var(--azul-oscuro);
}

.contacto-map {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: 500px;
    border: 1px solid #ddd;
}

.contacto-map iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Mensaje de formulario */
.form-message {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    display: none;
    text-align: center;
    font-weight: 500;
}

.form-message.success {
    background: rgba(54, 180, 73, 0.2);
    border: 1px solid var(--verde);
    color: var(--verde);
    display: block;
}

.form-message.error {
    background: rgba(238, 28, 37, 0.2);
    border: 1px solid var(--rojo);
    color: var(--rojo);
    display: block;
}

/* Estilos para el spinner de envío */
button[type="submit"] i.fa-spinner {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Iconos de estado */
.fa-check {
    color: var(--verde);
    margin-right: 8px;
}

/* =========================================== */
/* ESTILOS DEL CARRITO ACTUALIZADO */
/* =========================================== */
.carrito-sidebar {
    position: fixed;
    right: -350px;
    top: 0;
    width: 350px;
    height: 100vh;
    background: var(--beige);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s;
    padding: 1.5rem;
    z-index: 1002;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.carrito-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gris-claro);
}

.carrito-items {
    flex: 1;
    min-height: 240px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
}

/* Scrollbar personalizada para el carrito */
.carrito-items::-webkit-scrollbar {
    width: 6px;
}

.carrito-items::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}

.carrito-items::-webkit-scrollbar-thumb {
    background: rgba(26, 8, 70, 0.2);
    border-radius: 10px;
}

.carrito-items::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 8, 70, 0.3);
}

/* Estilos mejorados para los items del carrito */
.carrito-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    position: relative;
}

.carrito-item:last-child {
    border-bottom: none;
}

.carrito-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    background: white;
    padding: 5px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.carrito-item-info {
    flex: 1;
    min-width: 0;
}

.carrito-item-info h4 {
    font-size: 0.95rem;
    color: var(--azul-oscuro);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carrito-item-info p {
    font-size: 0.9rem;
    color: var(--rojo);
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.carrito-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.carrito-item-controls button {
    width: 25px;
    height: 25px;
    border: none;
    background: var(--azul-oscuro);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 0.8rem;
}

.carrito-item-controls button:hover {
    background: var(--verde);
    transform: scale(1.1);
}

.carrito-item-controls span {
    min-width: 25px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

.eliminar-item {
    position: absolute;
    top: 15px;
    right: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.eliminar-item:hover {
    color: white;
    background: var(--rojo);
    transform: rotate(90deg);
}

.carrito-total {
    text-align: right;
    padding: 1.5rem 0;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--azul-oscuro);
    border-bottom: 1px solid var(--gris-claro);
    margin-bottom: 1.5rem;
}

.carrito-total h4 {
    display: inline;
    margin-right: 1rem;
}

#carrito-total-precio {
    color: var(--rojo);
    font-size: 1.6rem;
}


/* =========================================== */
/* ESTILOS DEL CARRITO - BOTÓN CERRAR MEJORADO */
/* =========================================== */

.cerrar-carrito {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: var(--rojo);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.cerrar-carrito:hover {
    background: #c8161d;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.cerrar-carrito:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(238, 28, 37, 0.4);
}

/* Ajuste para móviles */
@media (max-width: 768px) {
    .cerrar-carrito {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
        top: 10px;
        right: 10px;
    }
}



/* Formulario de pedido */
.pedido-form {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.pedido-form h4 {
    color: var(--azul-oscuro);
    margin-bottom: 1.1rem;
    font-size: 1.1rem;
    text-align: center;
    position: relative;
    padding-bottom: 0.8rem;
}

.pedido-form h4::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--dorado);
}

.form-group {
    margin-bottom: 0.8rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    color: var(--azul-oscuro);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

.form-group textarea {
    min-height: 80px;
}

.form-actions {
    margin-top: 1.5rem;
}

.btn-enviar-pedido {
    width: 100%;
    padding: 1rem;
    background: var(--azul-oscuro);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.btn-enviar-pedido:hover {
    background: var(--verde);
    color: var(--azul-oscuro);
}

/* Mensaje de estado del pedido */
#pedido-message {
    margin-top: 1.5rem;
}

/* Notificación de carrito */
.notificacion {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #36B449;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: slideUp 0.5s ease-out forwards;
}

.notificacion button {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0 0 1rem;
}

/* =========================================== */
/* FOOTER */
/* =========================================== */
footer {
    background: var(--azul-oscuro);
    color: var(--beige);
    padding: 4rem 5%;
    margin-top: 5rem;
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.footer-section {
    padding: 1rem;
}

.footer-section h4 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--dorado);
    position: relative;
    padding-bottom: 0.8rem;
}

.footer-section h4::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--dorado);
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-icons a {
    color: var(--beige);
    font-size: 1.8rem;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--dorado);
    transform: translateY(-3px);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: var(--beige);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.footer-section ul li a i {
    color: var(--dorado);
    font-size: 0.9rem;
}

.footer-section ul li a:hover {
    color: var(--dorado);
}

.contacto-info p {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.contacto-info p i {
    color: var(--dorado);
    margin-top: 5px;
    min-width: 20px;
}

/* =========================================== */
/* LEGAL Y COPYRIGHT */
/* =========================================== */
.legal {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem 5%;
    text-align: center;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.legal a {
    color: var(--beige);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.legal a:hover {
    color: var(--dorado);
    text-decoration: underline;
}

.legal p {
    color: rgba(255,255,255,0.7);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* =========================================== */
/* MODALES */
/* =========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2.5rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--rojo);
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px 10px;
    margin-top: 20px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* =========================================== */
/* ANIMACIONES */
/* =========================================== */
@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        bottom: -50px;
        opacity: 0;
    }
    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================== */
/* RESPONSIVE DESIGN - TODOS LOS ESTILOS MOVILES AL FINAL */
/* =========================================== */
@media (min-width: 1600px) {
    .hero-content {
        transform: translate(-50%, -60%);
    }
    /* Para pantallas muy grandes, mostrar 5 productos */
    .productos-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }    
}

@media (max-width: 1200px) {
    .hero-content h1 {
        font-size: 4rem;
    }
    /* Para pantallas medianas, mostrar 4 productos */
    .productos-grid {
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    }    
}

@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .hero-content .slogan {
        font-size: 1.6rem;
    }
    
    .hero-content .subtitulo {
        font-size: 1.2rem;
    }
    /* Para tablets, mostrar 3 productos */
    .productos-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }    
    
    .mision-vision {
        grid-template-columns: 1fr;
    }
    
    .contacto-container {
        grid-template-columns: 1fr;
    }

    .nosotros-container {
        grid-template-columns: 1fr;
    }
    
    .nosotros-texto {
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    /* Ajustes generales */
    body {
        background-attachment: scroll;
    }
    
    /* Navbar y menú hamburguesa */
    .navbar {
        padding: 0.8rem 5%;
        height: 80px;
    }
    
    .logo img {
        height: 50px;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--azul-oscuro);
        flex-direction: column;
        padding: 1.5rem 0;
        transform: translateY(-150%);
        transition: transform 0.3s ease-out;
        z-index: 1001;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }
    
    .nav-links.active {
        display: flex;
        transform: translateY(0);
    }
    
    .nav-links li {
        padding: 0.8rem 2rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links li a {
        color: white;
        font-size: 1.1rem;
        padding: 0.5rem 0;
        display: block;
    }
    
    /* Ocultar el carrito del navbar en móviles */
    .navbar .cart-btn:not(.floating) {
        display: none !important;
    }
    
    /* Botón flotante del carrito - SOLO para móviles */
    .cart-btn.floating {
        display: flex !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        justify-content: center;
        align-items: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        background: var(--rojo);
        color: white;
        border: none;
        transition: all 0.3s;
        text-decoration: none;
    }

    .cart-btn:not(.floating) {
        display: none !important; /* Oculta el botón del navbar en móviles */
    }
    
    .cart-btn.floating span {
        position: absolute;
        top: -5px;
        right: -5px;
        background: white;
        color: var(--rojo);
        border-radius: 50%;
        width: 25px;
        height: 25px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.8rem;
        font-weight: bold;
        border: 2px solid var(--rojo);
    }
    
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        cursor: pointer;
        z-index: 1000;
    }
    
    .menu-toggle span {
        width: 100%;
        height: 3px;
        background: white;
        border-radius: 2px;
        transition: all 0.3s;
    }
    
    .navbar.active .menu-toggle span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .navbar.active .menu-toggle span:nth-child(2) {
        opacity: 0;
    }
    
    .navbar.active .menu-toggle span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero section */
    .hero {
        height: 80vh;
        margin-top: 80px;
    }
    
    .hero-content {
        padding: 1.5rem;
        width: 95%;
        backdrop-filter: blur(2px) brightness(0.6);
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .hero-content .slogan {
        font-size: 1.3rem;
        margin: 1rem 0 0.5rem;
    }
    
    .hero-content .subtitulo {
        font-size: 1rem;
    }
    
    /* Productos */
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .producto-card {
        padding: 0.8rem;
    }
    
    .producto-card img {
        height: 120px;
    }
    
    .producto-card h3 {
        font-size: 0.95rem;
        min-height: 40px;
    }
    
    .producto-card p {
        font-size: 0.85rem;
        min-height: 60px;
    }
    
    .producto-card button {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    /* Promociones */
    .promociones-grid {
        grid-template-columns: 1fr;
    }
    
    /* Nosotros */
    .nosotros-container {
        grid-template-columns: 1fr;
        padding: 0;
    }
    
    .nosotros-texto {
        padding-right: 0;
    }
    
    .nosotros-galeria {
        grid-template-columns: 1fr;
        margin-top: 2rem;
    }
    
    /* Misión/visión */
    .mision-vision {
        grid-template-columns: 1fr;
        padding: 2rem;
    }
    
    .mision, .vision {
        padding: 1.5rem;
    }
    
    /* Contacto */
    .contacto-container {
        grid-template-columns: 1fr;
    }
    
    .contacto-map {
        height: 300px;
        order: -1;
    }
    
    /* Carrito */
    .carrito-sidebar {
        width: 100vw !important; /* Usar viewport width en lugar de porcentaje */
        right: -100vw !important; /* Cuando está cerrado */
        padding: 1rem;
        z-index: 1002;
        max-width: none !important;
    }
    
    /* Cuando el carrito está abierto */
    .carrito-sidebar[style*="right: 0px"],
    .carrito-sidebar[style*="right: 0"] {
        right: 0 !important;
        width: 100vw !important;
    }
    

    .carrito-items {
        max-height: 50vh;
    }
    
    .carrito-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .carrito-item-img {
        width: 80px;
        height: 80px;
    }
    
    .carrito-item-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-section {
        padding: 1rem 0;
    }
    
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 480px) {

    /* Para móviles pequeños, mostrar 1 producto */
    .productos-grid {
        grid-template-columns: 1fr !important;
    }   
    .historia-intro i:first-child,
    .historia-intro i:last-child,
    .historia-destacado i:first-child,
    .historia-destacado i:last-child {
        display: none;
    }
    
    .historia-intro,
    .historia-destacado {
        padding: 1.2rem;
    }
    
    .historia-cierre {
        padding: 1.2rem;
    }
    
    /* Ajustes adicionales para pantallas muy pequeñas */
    .carrito-header h3 {
        font-size: 1.2rem;
    }
    
    .carrito-item-info h4 {
        font-size: 1rem;
    }
    
    .carrito-item-info p {
        font-size: 0.9rem;
    }
    
    .carrito-total h4 {
        font-size: 1.1rem;
    }
    
    #carrito-total-precio {
        font-size: 1.3rem;
    }
}

.light-video .hero-content {
    --text-color: rgba(26, 8, 70, 0.95);
    --shadow-color: rgba(255, 255, 255, 0.7);
    
    color: var(--text-color);
    text-shadow: 2px 2px 4px var(--shadow-color);
    backdrop-filter: blur(2px) brightness(0.8);
    background: linear-gradient(
        45deg,
        rgba(var(--azul-oscuro-rgb), 0.6) 0%,
        rgba(var(--rojo-rgb), 0.3) 100%
    );
}

.light-video .hero-content h1::after {
    background: var(--azul-oscuro);
}

/* =========================================== */
/* ELEMENTO FLOTANTE BEANSTALK - MEJORADO PARA MÓVILES */
/* =========================================== */
.beanstalk-footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--azul-oscuro);
    color: var(--beige);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(26, 8, 70, 0.4);
    border: 2px solid var(--dorado);
    z-index: 999;
    transition: all 0.3s ease;
    transform: translateY(0);
    opacity: 0.95;
    backdrop-filter: blur(5px);
    animation: float 6s ease-in-out infinite;
    min-width: 180px; /* Ancho mínimo para asegurar que el texto sea visible */
}

.beanstalk-footer:hover {
    background: linear-gradient(135deg, var(--azul-oscuro) 0%, #2a1b5e 100%);
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(26, 8, 70, 0.6);
    opacity: 1;
}

.beanstalk-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    padding: 6px;
    border: 2px solid var(--dorado);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    flex-shrink: 0; /* Evita que el logo se reduzca */
}

.beanstalk-footer:hover .beanstalk-logo {
    transform: scale(1.1) rotate(5deg);
}

.beanstalk-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.beanstalk-footer span {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--dorado);
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: inline-block; /* Asegura que el texto sea visible */
}

/* Animación de flotación */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Ajustes para tablets */
@media (max-width: 768px) {
    .beanstalk-footer {
        bottom: 20px;
        right: 20px;
        padding: 14px 20px; /* Padding aumentado */
        gap: 12px;
        min-width: 200px; /* Ancho mínimo aumentado */
        opacity: 0.98; /* Más visible en móviles */
    }
    
    .beanstalk-logo {
        width: 45px; /* Logo más grande */
        height: 45px;
        padding: 7px;
    }
    
    .beanstalk-footer span {
        font-size: 1rem; /* Texto más grande */
        letter-spacing: 0.5px;
        display: inline-block !important; /* Forzar visibilidad */
    }
    
    /* Para evitar conflictos con el botón del carrito en móviles */
    .cart-btn.floating + .beanstalk-footer {
        right: 20px;
        bottom: 100px; /* Subir un poco para no solapar con el carrito */
    }
}

/* Para móviles medianos y pequeños */
@media (max-width: 600px) {
    .beanstalk-footer {
        bottom: 15px;
        right: 15px;
        padding: 12px 18px;
        min-width: 180px;
        gap: 10px;
    }
    
    .beanstalk-logo {
        width: 40px;
        height: 40px;
        padding: 6px;
    }
    
    .beanstalk-footer span {
        font-size: 0.9rem;
    }
    
    .cart-btn.floating + .beanstalk-footer {
        bottom: 95px;
    }
}

/* Para pantallas muy pequeñas (móviles pequeños) */
@media (max-width: 480px) {
    .beanstalk-footer {
        bottom: 15px;
        right: 15px;
        padding: 10px 16px;
        min-width: 170px; /* Ancho suficiente para logo y texto */
        gap: 8px;
        border-radius: 40px; /* Bordes ligeramente menos redondeados */
    }
    
    .beanstalk-logo {
        width: 38px; /* Logo visible pero no demasiado grande */
        height: 38px;
        padding: 5px;
    }
    
    .beanstalk-footer span {
        font-size: 0.85rem; /* Texto legible */
        letter-spacing: 0.3px;
        display: inline-block !important; /* Asegurar visibilidad */
        white-space: nowrap; /* Evitar que el texto se divida en varias líneas */
    }
    
    /* Eliminar el efecto hover que ocultaba el texto en móviles pequeños */
    .beanstalk-footer:hover span {
        display: inline-block !important;
        position: static;
        background: none;
        padding: 0;
        border-radius: 0;
        margin-right: 0;
        border: none;
        transform: none;
    }
    
    /* Ajuste de posición cuando hay botón de carrito */
    .cart-btn.floating + .beanstalk-footer {
        bottom: 90px;
    }
}

/* Para pantallas extremadamente pequeñas */
@media (max-width: 360px) {
    .beanstalk-footer {
        min-width: 160px;
        padding: 8px 14px;
    }
    
    .beanstalk-logo {
        width: 35px;
        height: 35px;
    }
    
    .beanstalk-footer span {
        font-size: 0.8rem;
    }
}

/* Para pantallas grandes */
@media (min-width: 1200px) {
    .beanstalk-footer {
        bottom: 25px;
        right: 25px;
        padding: 15px 25px;
        gap: 15px;
        min-width: 200px;
    }
    
    .beanstalk-logo {
        width: 45px;
        height: 45px;
        padding: 8px;
    }
    
    .beanstalk-footer span {
        font-size: 1rem;
    }
}