:root {
  --primary-color: #2a5c7c;
  --primary-dark: #1e4560;
  --secondary-color: #d1aa09;
  --text-color: #333;
  --light-gray: #e2e2e2;
  --dark-gray: #888;
  --white: #fff;
  --black: #000;
  --accent-color: #5d9cec;
  --transition: all 0.3s ease;
}

/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  padding-top: 80px; /* Compensa header fijo globalmente */
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

p {
  padding: 10px 10px 10px 20px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.text-block {
  max-width: 800px;
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
  color: #333;
  line-height: 1.8;
  font-family: 'Open Sans', 'Helvetica Neue', sans-serif;
}

.text-block .lead {
  font-size: 1.25rem;
  color: #5a3921;
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  letter-spacing: 0.3px;
}

ul {
  padding: 15px 15px 15px 20px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  margin: 10px 10px 10px 20px;
}


.btn-primary, .btn-secondary, .btn-outline {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #2a5c7c;
    color: white;
}

.btn-primary:hover {
    background-color: #1e4560;
}

.btn-secondary {
    background-color: #e2e2e2;
    color: #333;
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

.btn-outline {
    border: 2px solid #2a5c7c;
    color: #2a5c7c;
    background: transparent;
}

.btn-outline:hover {
    background-color: #2a5c7c;
    color: white;
}

/* Header mejorado */
.site-header {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo img {
  height: 60px;
  width: auto;
  transition: var(--transition);
}

.logo img:hover {
  opacity: 0.9;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
}

.main-nav a {
  font-weight: 600;
  padding: 5px 0;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.main-nav a:hover::after {
  width: 100%;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.cart-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.cart-counter {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

/* Hero section mejorada */
.hero {
  background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('/assets/images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  height: calc(50vh - 80px);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
  position: relative;
}

.hero-content {
  width: 90%;
  max-width: 800px;
  padding: 20px;
  animation: fadeInUp 2.8s ease-out;
}

.hero-history {
  background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('/assets/images/hero-bg2.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  height: calc(120vh - 80px);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
  position: relative;
  padding: 0 15px;
}

.hero-content-history {
  font-size: 1.6rem;
  max-width: 100%;
  padding: 0 15px;
  animation: scrollText 10s linear;
}

@keyframes scrollText {
  0% {
    transform: translateY(50%);
  }
  100% {
    transform: translateY(0%); /* Desplaza hacia arriba */
  }
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  margin-bottom: 10px;
  text-shadow: 2px 2px 3px rgba(0,0,0,0.9);
}

/* Productos mejorados */
.featured-products {
  padding: 20px 0 20px;
  align-items: center; /* Centra los elementos hijos */
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  color: var(--primary-color);
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background-color: var(--accent-color);
  margin: 15px auto 0;
}

.sostenibilidad {
    padding: 2rem 0;
}
.sostenibilidad-hero {
    text-align: center;
    margin-bottom: 3rem;
}
.divider {
    width: 100px;
    height: 3px;
    background: var(--primary-dark);
    margin: 1rem auto;
}

.image-container {
  display: flex;
  justify-content: center; /* Centrado horizontal */
  align-items: center; /* Centrado vertical */
  width: auto;
  height: auto;
  margin: 2rem 0;
}

.image {
  width: auto;
  height: auto;
  opacity: 0;
  transform: scale(0.1);
  transition: opacity 2s ease-out, transform 2s ease-out;
  margin: 0 auto; /* Refuerza el centrado horizontal */
}

/* Clase que se añadirá con JavaScript cuando sea visible */
.image.visible {
  opacity: 1;
  transform: scale(1) rotate(0);
  animation: splashEffect 6.5s ease-out forwards;
}

@keyframes splashEffect {
  0% {
    transform: scale(0.4) rotate(-10deg);
  }
  75% {
    transform: scale(1.05) rotate(10deg);
  }
  100% {
    transform: scale(1.0) rotate(0);
  }
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  justify-content: center; /* Añade esto */
  justify-items: center; /* Y esto */
  gap: 30px;
  padding: 20px 0; /* Espaciado vertical */
}

.product-card {
  width: 400px; /* Ancho fijo */
  height: 570px; /* Se ajusta al contenido */
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  background-image: linear-gradient(rgba(255,255,255,0.8), rgba(255,255,255,0.1)), url('/assets/images/fondo.jpg');
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.9);
  background-image: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0.1)), url('/assets/images/fondo.jpg');
  border-color: var(--primary-color);
}

.product-card img {
  padding: 15px;
  width: 100%;
  height: 350px;
  object-fit: contain;
}

.product-info {
  padding: 10px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-card h3 {
  text-align: center;
  padding: 0 15px;
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--primary-dark);
}

@keyframes smoothFade {
  0%, 100% {
    opacity: 0.5; /* Nunca desaparece completamente */
  }
  50% {
    opacity: 1.1;
  }
}

.sticker {
  text-align: center;
  color: var(--white);
  animation: smoothFade 1s ease-in-out infinite;
  font-size: 1.2rem;
  margin: 5px;
  flex-grow: 1;
}

.description {
  text-align: justify;
  font-size: 0.9rem;
  margin: 0px;
  flex-grow: 1;
}

.product-ideal {
  width: auto; 
  padding:  0px;

  border-radius: 4px;             /* Esquinas redondeadas */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); /* Sombra suave */
  font-size: 1.0rem;
  color: var(--primary-dark);
  text-align: justify; /* Texto justificado a ambos lados */
  text-justify: inter-word;
}

.product-ideal:hover {
  transform: translateY(-2px);   /* Levanta ligeramente */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.product-description {
  min-width: 280px;
  width: auto; 
  padding:  0px;
  font-size: 1.1rem;
  flex-grow: 1;
  text-align: justify; /* Texto justificado a ambos lados */
  text-justify: inter-word;
}

/* Variantes de productos mejoradas */
.variant-selector {
  margin: 15px 0;
}

.variant-select {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  background-color: var(--white);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.variant-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(42, 92, 124, 0.2);
}

.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.variant-option {
  border: 1px solid var(--light-gray);
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  background-color: var(--white);
}

.variant-option:hover {
  border-color: var(--primary-color);
}

.variant-option.selected {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.price-container {
  margin: 15px 0;
}

.current-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.unit-price {
  font-size: 0.9rem;
  color: var(--dark-gray);
  margin-left: 5px;
}

/* Detalle de producto mejorado */
.product-detail-content {
  display: grid;
  grid-template-columns: 0.2fr 1fr;
  gap: 10px;
  padding: 20px 0;
}

.product-images {

  width: 180px;
  flex-direction: column;
  gap: 15px;
}

.main-image img {
  width: 180px;
  border-radius: 4px;
  box-shadow: 0 5px 10px rgba(0,0,0,0.9);
}

.product-info h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  margin-bottom: 15px;
  color: var(--primary-dark);
}

.product-meta {
  margin: 20px 0;
  font-size: 0.9rem;
}

.product-meta p {
  margin-bottom: 8px;
}

/* Selector de cantidad mejorado */
.quantity-selector {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.quantity-btn {
  background: var(--light-gray);
  border: none;
  width: 35px;
  height: 35px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border-radius: 4px;
}

.quantity-btn:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

.quantity-input {
  width: 60px;
  height: 35px;
  text-align: center;
  margin: 0 10px;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  font-weight: bold;
}

/* Footer mejorado */
.montanas {
  background-image: url('/assets/images/footer.png');
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: center top;
  height: 150px;
  width: 100%;
  position: relative;
  z-index: 1;
  margin-top: 0px;
}

.site-footer {
  background-color: var(--black);
  color: var(--white);
  padding: 80px 0 30px;
  position: relative;
  margin-top: -25px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h3 {
  font-family: 'Playfair Display', serif;
  margin-bottom: 20px;
  font-size: 1.3rem;
  position: relative;
  display: inline-block;
}

.footer-section h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 50px;
  height: 2px;
  background-color: var(--accent-color);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 12px;
}

.footer-section a {
  color: #cccccc;
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--white);
  padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    transition: transform 0.3s ease;
}

.social-icons a:hover {
    transform: translateY(-3px);
}

.social-icons img {
    width: 36px;
    height: 36px;
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

.social-icons img:hover {
    filter: brightness(1);
}

.copyright {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: var(--dark-gray);
}

/* Animaciones */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 480px) {
  .product-detail-content {
    grid-template-columns: 0.2fr 1fr;
    gap: 30px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  
 .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Ajusta el ancho mínimo */
    max-width: 340px; /* Igual al ancho de tus tarjetas */
    margin: 0 auto; /* Centra el grid completo */
    width: 100%; /* Asegura que respete el max-width */
  }
  
  .product-card {
    width: 100%; /* Ocupa todo el espacio disponible */
    max-width: 340px; /* Máximo igual al grid */
  }
  
  .footer-content {
    grid-template-columns: 1fr 1fr;
    text-align: center;
  }
  
  .footer-section h3::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .social-icons {
    justify-content: center;
  }
  
  .montanas {
    height: 100px;
    background-size: cover;
  }
}

@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
  
  .hero {
    height: 70vh;
    min-height: 80px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .variant-options {
    flex-direction: column;
  }
  
  .variant-option {
    width: 100%;
    text-align: center;
  }
}