/* Reinicio básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  /* Cambiamos la fuente a Merriweather */
  font-family: 'Merriweather', serif;
  color: #333;
}

/* Contenedor genérico */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------------------------------- */
/* ENCABEZADO (HEADER) */
header {
  background-color: #fff;
  border-bottom: 1px solid #eee;
  padding: 10px 0;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img {
  height: 65px;
}

/* Menú DESKTOP */
.desktop-nav ul {
  list-style: none;
  display: flex;
  gap: 30px; /* Aumentamos la separación */
}
.desktop-nav li a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  font-size: 1.2rem;
  padding: 6px 12px; /* Para que se note el hover */
  border-radius: 8px;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.desktop-nav li a:hover {
  background-color: #3CB371;
  color: #fff;
}

/* Menú móvil */
.mobile-menu-icon {
  font-size: 2rem;
  cursor: pointer;
  display: none;
}
.mobile-nav {
  display: none;
  background-color: #fff;
  border-bottom: 1px solid #eee;
}
.mobile-nav ul {
  list-style: none;
  padding: 10px;
}
.mobile-nav a {
  display: block;
  padding: 10px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
}
.mobile-nav a:hover {
  background-color: #bbbab0;
  color: #fff;
}
.mobile-nav.open {
  display: block;
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  .mobile-menu-icon {
    display: block;
  }
}

/* ---------------------------------- */
/* SECCIÓN DEL VIDEO */
.hero-video {
  position: relative;
  width: 100%;
  height: 60vh;
  overflow: hidden;
  border-top: 3px solid #dfdfdf;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.1);
}
/* Versión escritorio y móvil */
.hero-video-desktop {
  display: block;
}
.hero-video-movil {
  display: none;
}
@media (max-width: 768px) {
  .hero-video-desktop {
    display: none;
  }
  .hero-video-movil {
    display: block;
  }
}
.video-container {
  width: 100%;
  height: 100%;
  position: relative;
}
.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-text {
  position: absolute;
  left: 5%;
  bottom: 10%;
  color: #fff;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  animation: slide-up 1.5s ease forwards;
  opacity: 0;
}
.hero-text h1 {
  margin: 0;
}
.hero-text span {
  font-weight: 300;
}
@media (max-width: 768px) {
  .hero-video-movil .hero-text {
    font-size: 2.5rem;
  }
}
@keyframes slide-up {
  0% {
    transform: translateY(50px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ---------------------------------- */
/* ENCABEZADOS RECTANGULARES */
.heading-section {
  width: 100%;
  background-color: #2E8B57;
  color: #fff;
  text-align: center;
  padding: 20px 0;
  margin-bottom: 30px;
}
.heading-section h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}
.heading-section#contacto {
  margin-top: 0 !important; /* Quitar margen extra */
}

/* ---------------------------------- */
/* SECCIÓN NOSOTROS */
.culture-container-desktop {
  display: flex;
  align-items: stretch;
  margin: 50px auto;
  position: relative;
}
.culture-container-desktop .culture-image {
  flex: 0 0 50%;
}
.culture-container-desktop .culture-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0 0 0 60px;
}
.culture-container-desktop .culture-text {
  flex: 0 0 50%;
  background-color: #3CB371;
  color: #fff;
  padding: 2rem;
  border-radius: 0 60px 60px 0;
  margin-left: -2rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.culture-container-desktop .culture-text h2 {
  margin-bottom: 1rem;
}
.culture-container-desktop .culture-text p {
  line-height: 1.5;
}
@media (max-width: 768px) {
  .culture-container-desktop {
    display: none;
  }
}

/* MÓVIL NOSOTROS */
.culture-container-mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  margin: 50px auto;
  position: relative;
}
.culture-container-mobile .culture-text {
  background-color: #3CB371;
  color: #fff;
  padding: 2rem;
  border-radius: 0 60px 0 0;
  position: relative;
  z-index: 2;
  margin-bottom: -2rem;
}
.culture-container-mobile .culture-text h2 {
  margin-bottom: 1rem;
}
.culture-container-mobile .culture-text p {
  line-height: 1.5;
}
.culture-container-mobile .culture-image {
  position: relative;
  z-index: 1;
}
.culture-container-mobile .culture-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0 0 60px 60px;
}
@media (max-width: 768px) {
  .culture-container-mobile {
    display: flex;
  }
}

/* ---------------------------------- */
/* ENVOLTORIO PARA PRODUCTOS */
.productos-background {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 80vh;
  margin-bottom: 0;
  padding-bottom: 50px; /* Espacio extra */
  background: url("img/fondo.jpg") center center / cover no-repeat;
}

/* PRODUCTOS ESCRITORIO */
.productos-container-desktop {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 50px auto 0 auto;
  position: relative;
  align-items: stretch; /* Cada columna se ajusta a la más alta */
}
.product-card {
  background-color: #f5f5f5;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  /* Para alinear el botón al fondo */
  display: flex;
  flex-direction: column;
}
.product-card img {
  display: block;
  margin: 0 auto;
  max-width: 180px;
  max-height: 270px;
  object-fit: cover;
}
.product-card h3 {
  margin-bottom: 0.5rem;
  /* Forzamos un ancho máx y envolvemos texto si es muy largo */
  max-width: 200px;
  margin: 0.5rem auto;
  word-wrap: break-word;
}
.btn-add-cart {
  background-color: #28a745;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  margin-top: auto;   /* Empuja el botón hacia la parte baja */
  align-self: center; /* Centrado en eje X */
}
.btn-add-cart:hover {
  background-color: #218838;
}

/* PRODUCTOS MÓVIL */
.productos-container-mobile {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 50px auto 0 auto;
  position: relative;
  align-items: stretch;
}
.productos-container-mobile .product-card {
  background-color: #f5f5f5;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}
.productos-container-mobile .product-card img {
  display: block;
  margin: 0 auto;
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
}
.productos-container-mobile .product-card h3 {
  max-width: 180px;
  margin: 0.5rem auto;
  word-wrap: break-word;
}
.productos-container-mobile .btn-add-cart {
  margin-top: auto;
  align-self: center;
}
@media (max-width: 768px) {
  .productos-container-desktop {
    display: none;
  }
  .productos-container-mobile {
    display: grid;
  }
}

/* ---------------------------------- */
/* SECCIÓN DE CONTACTO ESCRITORIO */
.contact-desktop {
  display: flex;
  align-items: stretch;
  margin: 50px auto;
  position: relative;
}
.contact-text {
  flex: 0 0 50%;
  background-color: #3CB371;
  color: #fff;
  padding: 2rem;
  border-radius: 0 0 0 60px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.contact-text h2 {
  margin-bottom: 1rem;
  color: #fff;
}
.contact-text p {
  line-height: 1.5;
  margin-bottom: 1rem;
}
.contact-map {
  flex: 0 0 50%;
  position: relative;
}
.contact-map iframe {
  width: 100%;
  height: auto;
  border: none;
  border-radius: 0 0 60px 0;
  min-height: 300px;
}

/* CONTACTO MÓVIL */
.contact-mobile {
  display: none;
  flex-direction: column;
  margin: 50px auto;
  position: relative;
}
.contact-mobile .contact-text {
  background-color: #3CB371;
  color: #fff;
  padding: 2rem;
  border-radius: 0 60px 0 0;
  position: relative;
  z-index: 2;
  margin-bottom: -2rem;
}
.contact-mobile .contact-text h2 {
  margin-bottom: 1rem;
}
.contact-mobile .contact-text p {
  line-height: 1.5;
  margin-bottom: 1rem;
}
.contact-mobile .contact-map {
  position: relative;
  z-index: 1;
}
.contact-mobile .contact-map iframe {
  width: 100%;
  height: auto;
  border: none;
  border-radius: 0 0 60px 60px;
  min-height: 300px;
}
@media (max-width: 768px) {
  .contact-desktop {
    display: none;
  }
  .contact-mobile {
    display: flex;
  }
}

/* Enlaces de WhatsApp */
.whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}
.whatsapp-link:hover {
  color: #bbbab0;
}
.whatsapp-link img {
  width: 24px;
  height: 24px;
}

/* ---------------------------------- */
/* BOTÓN FLOTANTE DEL CARRITO */
.floating-cart {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  background-color: #2E8B57;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 9999;
}
.floating-cart .cart-icon {
  width: 34px;
  height: auto;
}
.floating-cart .cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #28a745;
  color: #fff;
  font-size: 0.75rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ---------------------------------- */
/* ESTILOS DE MODALES (carrito y detalle) */

.modal.hidden {
  display: none;
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}
.modal-overlay {
  position: absolute;
  background-color: rgba(0,0,0,0.4);
  width: 100%;
  height: 100%;
}
.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;     /* Altura máxima */
  transform: translate(-50%, -50%);
  background-color: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);

  display: flex;
  flex-direction: column;
}

/* CARRITO */
.modal-body-cart {
  flex: 1 1 auto;          /* Crece y permite scroll interno */
  overflow-y: auto;        
  margin-top: 1rem;
}
.modal-footer-cart {
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Ajuste: imágenes un poco más grandes en el carrito */
.cart-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.cart-item {
  background-color: #f8f8f8;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 5px;

  display: flex;
  justify-content: center; 
  align-items: center;
  gap: 15px;
  width: 90%;
}
.cart-item img {
  width: 90px;  /* <-- Aumentamos el tamaño para que sea más grande */
  height: auto;
  border-radius: 5px;
  flex-shrink: 0;
}
.cart-item-info {
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center; 
  text-align: center;
}
.cart-item-info strong {
  word-wrap: break-word; 
  margin-bottom: 4px;
}
.cart-quantity-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}
.btn-cart-minus, .btn-cart-plus {
  background-color: #2E8B57;
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
}
.cart-input-qty {
  width: 50px;
  text-align: center; 
}
.btn-remove-product {
  background-color: #e53935;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  margin-top: 5px;
}
.btn-remove-product:hover {
  background-color: #c62828;
}
.btn-whatsapp,
.btn-close-cart {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.btn-whatsapp {
  background-color: #25D366;
  color: #fff;
}
.btn-whatsapp:hover {
  background-color: #1ebe5b;
}
.btn-close-cart {
  background-color: #ccc;
}
.btn-close-cart:hover {
  background-color: #aaa;
}

/* DETALLE DE PRODUCTO */
.modal-body-product {
  flex: 1 1 auto; 
  overflow-y: auto;
  margin-top: 1rem;
}
.modal-footer-product {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start; 
  gap: 10px;
  margin-top: 1rem;
}
.product-detail {
  display: flex;
  flex-direction: column;
  /* Mantiene texto a la izquierda, pero ... */
  align-items: flex-start; 
}

/* ... centramos la imagen en eje X con margin auto */
.product-detail img {
  display: block;
  margin: 0 auto 1rem;  /* la imagen se alinea al centro */
  max-width: 250px;
  max-height: 400px;
  width: auto;
  height: auto;
}
.scroll-desc {
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 0 10px;
  text-align: justify;
}
.quantity-container {
  /* Sin text-align center, para que se mantenga a la izquierda */
}
.quantity-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
}
.btn-quantity {
  background-color: #2E8B57;
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
}
#detailQuantity {
  width: 60px;
  text-align: center;
}
.buttons-container {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}
.btn-ficha {
  display: inline-block;
  background-color: #ffc107;
  color: #fff;
  padding: 0.5rem 1rem;
  margin: 0;
  text-decoration: none;
  border-radius: 5px;
  cursor: pointer;
}
.btn-ficha:hover {
  background-color: #e0a800;
}
.btn-detail-add,
.btn-close-detail {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.btn-detail-add {
  background-color: #28a745;
  color: #fff;
}
.btn-detail-add:hover {
  background-color: #218838;
}
.btn-close-detail {
  background-color: #ccc;
}
.btn-close-detail:hover {
  background-color: #aaa;
}