/* =========================================================
COCOAMONT TORTAS.CSS — VERSIÓN ELEGANTE PREMIUM
========================================================= */

/* === VARIABLES === */
:root {
  --primary: #42220D;         /* Base CocoaMont */
  --gold: #D2691E;            /* Dorado principal */
  --cream: #f9f4e8;           /* Fondo crema suave */
  --light: #ffffff;
  --dark: #1f1f1f;
  --accent: #b8912f;          /* Dorado más oscuro */
  --shadow: rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--cream);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* === TIPOGRAFÍA === */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  color: var(--primary);
  font-weight: 600;
}

/* =========================================================
HEADER NAVBAR V2 UNIFICADO Y FUNCIONAL
========================================================= */
.navbar-v2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-v2.shrink {
  padding: 8px 5%;
}

.navbar-v2 .logo img {
  height: 60px;
  transition: all 0.3s ease;
}

.navbar-v2.shrink .logo img {
  height: 45px;
}

/* ======= NAV LINKS ======= */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-list a {
  color: var(--light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-list a:hover {
  color: var(--gold);
}

/* ======= SUBMENÚ ======= */
.has-submenu {
  position: relative;
}
.has-submenu > a i {
  font-size: 0.7rem;
  margin-left: 6px;
}
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--light);
  list-style: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 10px 0;
  display: none;
  flex-direction: column;
  min-width: 220px;
  z-index: 999;
}
.submenu li a {
  display: block;
  color: var(--primary);
  padding: 10px 20px;
  transition: background 0.3s ease;
}
.submenu li a:hover {
  background: var(--cream);
}
.has-submenu:hover .submenu {
  display: flex;
}

/* ======= BOTÓN MENÚ MÓVIL ======= */
.mobile-menu-btn {
  background: none;
  border: none;
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--light);
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 2000;
  transition: color 0.3s ease;
}

.mobile-menu-btn i,
.mobile-menu-btn .menu-text {
  color: var(--light);
  transition: color 0.3s ease;
}

/* ======= MODO MÓVIL CON SLIDE DOWN ELEGANTE ======= */
@media (max-width: 900px) {
  /* Botón hamburguesa */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--light);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
  }

  /* Cambia el ícono al abrir el menú */
  .navbar-v2.active .mobile-menu-btn i {
    color: var(--primary);
  }

  
  @media (max-width: 768px) {
  .menu-section {
    padding: 140px 20px 60px; /* arriba, laterales, abajo */
    transition: padding-top 0.3s ease;
  }
}

  
  
  /* Contenedor principal del menú móvil */
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(249, 244, 232, 0.96); /* crema translúcido */
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 100px;
    transition: right 0.4s ease;
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
  }

  .main-nav.active {
    right: 0;
  }

  /* Lista principal */
  .nav-list {
    flex-direction: column;
    gap: 1.6rem;
    text-align: center;
  }

  .nav-list a {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
  }

  .nav-list a:hover {
    color: var(--gold);
  }

  /* ===== Submenús con animación slide ===== */
  .submenu {
    position: static;
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin-top: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .submenu li a {
    font-size: 1rem;
    color: var(--primary);
    padding: 6px 0;
  }

  .has-submenu.active .submenu {
    max-height: 400px; /* suficiente para mostrar todos */
    opacity: 1;
    margin-top: 5px;
  }

  /* Efecto visual del submenú */
  .has-submenu > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .has-submenu > a i {
    transition: transform 0.3s ease;
  }

  .has-submenu.active > a i {
    transform: rotate(180deg);
  }
}



/* =========================================================
PRODUCTOS (TORTAS)
========================================================= */


/* === CARD PRODUCTO === */
.menu-item {
  background: var(--light);
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: var(--transition);
}
.menu-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}

.item-image {
  width: 100%;
  height: 220px;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}
.item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-content {
  padding: 20px;
}

.item-title {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.variant-select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border 0.3s ease;
}
.variant-select:hover {
  border-color: var(--gold);
}

.price-display {
  color: var(--gold);
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 15px;
}

/* === BOTÓN AGREGAR === */
.add-to-cart-btn {
  width: 100%;
  background: var(--primary);
  color: var(--light);
  border: none;
  padding: 10px 0;
  border-radius: 30px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}
.add-to-cart-btn:hover {
  background: var(--gold);
  color: var(--primary);
}

/* =========================================================
CARRITO
========================================================= */
.cart-icon {
  position: fixed;
  bottom: 25px;                /* 📍 Ubicado en la parte inferior */
  right: 25px;                 /* 📍 Esquina derecha */
  background: #8B4513;
  color: white;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
}
.cart-icon:hover {
  transform: scale(1.08);
  background: var(--accent);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--primary);
  color: var(--light);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--light);
}

/* === CONTENEDOR DEL CARRITO === */
.cart-container {
  position: fixed;
  top: 100px;
  right: 25px;
  width: 380px;
  background: var(--light);
  border-radius: 18px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
}

.cart-header {
  background: var(--primary);
  color: var(--light);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-title {
  font-size: 1.2rem;
}
.close-cart {
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}
.close-cart:hover {
  color: var(--gold);
}

.cart-items {
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
}
.empty-cart-message {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 30px 0;
}

/* === ITEM EN CARRITO === */
.cart-item {
  border-bottom: 1px solid #eee;
  padding: 10px 0;
}
.cart-item:last-child {
  border-bottom: none;
}
.cart-item-name {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}
.cart-item-details {
  font-size: 0.85rem;
  color: #555;
}
.cart-item-subtotal {
  font-weight: 700;
  color: var(--gold);
}

.cart-quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.cart-quantity-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: var(--light);
  cursor: pointer;
  transition: var(--transition);
}
.cart-quantity-btn:hover {
  background: var(--gold);
  color: var(--primary);
}
.cart-quantity-display {
  font-weight: 600;
}

/* === TOTAL === */
.cart-total {
  background: #f4f1e9;
  padding: 15px 20px;
  border-top: 1px solid #ddd;
}
.total-price {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 12px;
}

/* === BOTONES DEL CARRITO === */
.cart-actions {
  display: flex;
  gap: 10px;
}
.cart-action-btn {
  flex: 1;
  padding: 10px;
  border-radius: 30px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.clear-cart {
  background: #666;
  color: var(--light);
}
.clear-cart:hover {
  background: #444;
}
.send-whatsapp {
  background: #25D366;
  color: white;
}
.send-whatsapp:hover {
  background: #128C7E;
}

/* === SCROLL === */
.cart-items::-webkit-scrollbar {
  width: 6px;
}
.cart-items::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}
.cart-items::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* =========================================================
   MODAL DE CHECKOUT ELEGANTE - VERSIÓN FINAL + FIX ANDROID
   ========================================================= */
.checkout-modal {
  position: fixed !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) !important;
  width: 95%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--light);
  border: none;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  padding: 0;
  animation: slideUpModal 0.4s ease;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
  overscroll-behavior: contain;
}

/* Fondo difuminado */
.modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(48, 48, 48, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1500;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
  touch-action: none;
}

.modal-backdrop.active {
  display: block;
  opacity: 1;
}

/* === HEADER DEL MODAL === */
.checkout-modal__header {
  background: var(--primary);
  color: var(--light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.checkout-modal__header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin: 0;
}
.checkout-close {
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}
.checkout-close:hover {
  color: var(--gold);
}

.checkout-title {
  color: white;
}

/* === CUERPO DEL MODAL === */
.checkout-modal__body {
  padding: 25px;
}
.checkout-hint {
  background: var(--cream);
  border-left: 4px solid var(--gold);
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  color: #555;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group--full {
  grid-column: span 2;
}
.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px !important; /* ✅ evita zoom Android */
  transition: border 0.3s ease, box-shadow 0.3s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
  outline: none;
}

/* === ALERTA DE ERROR === */
.form-alert {
  background: #ffe0e0;
  color: #a94442;
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
  font-size: 0.9rem;
  text-align: center;
}

/* === FOOTER DEL MODAL === */
.checkout-modal__footer {
  background: #f7f7f7;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #ddd;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  position: sticky;
  bottom: 0;
}
.btn-primary,
.btn-secondary {
  flex: 1;
  border-radius: 30px;
  border: none;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary {
  background: #25D366;
  color: #fff;
}
.btn-primary:hover {
  background: #128C7E;
}
.btn-secondary {
  background: #666;
  color: #fff;
}
.btn-secondary:hover {
  background: #444;
}

/* === ANIMACIÓN MODAL (entrada desde abajo con fade) === */
@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translate(-50%, 40%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .checkout-modal {
    width: 90%;
    max-height: calc(100dvh - 40px); /* ✅ evita corte con teclado Android */
  }
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

/* === FIX ANDROID MODAL MOVIMIENTO LATERAL === */
html,
body {
  overflow-x: hidden !important;
  overscroll-behavior: contain;
}

body.modal-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
  height: 100%;
  touch-action: none;
}

.checkout-modal {
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  contain: layout paint;
}


/* === FIX: una sola columna en móviles (Android + iOS) === */
@media (max-width: 768px) {
  .checkout-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .form-group,
  .form-group--full {
    width: 100%;
    grid-column: auto;
  }

  /* Evitar márgenes laterales ocultos en Android */
  #checkout-modal {
    width: 90%;
    max-width: 500px;
    margin: 0 auto;
  }

  /* Mejora el scroll vertical dentro del modal */
  .checkout-modal__body {
    max-height: calc(100dvh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}


/* === FIX DEFINITIVO: Modal centrado y estable en Android === */
@supports (-webkit-touch-callout: none) {
  /* ✅ Solo se aplica en navegadores basados en WebKit (Android/iOS) */
  #checkout-modal.checkout-modal {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    width: 92%;
    margin: 0 auto;
  }

  /* ✅ Forzar una sola columna en móviles (Android) */
  @media (max-width: 820px) {
    .checkout-grid {
      display: flex !important;
      flex-direction: column !important;
      gap: 16px !important;
    }

    .form-group,
    .form-group--full {
      width: 100% !important;
      grid-column: auto !important;
    }

    /* Scroll interno fluido */
    .checkout-modal__body {
      max-height: calc(100dvh - 220px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
  }

  /* ✅ Evitar desplazamiento lateral del fondo */
  html, body {
    overflow-x: hidden !important;
    width: 100%;
    position: relative;
  }
}


/* =========================================================
FOOTER Y COPYRIGHT
========================================================= */

footer {
  background-color: var(--primary);
  color: var(--light);
  padding: 60px 5% 30px;
  text-align: center;
}

.footer-link {
  color: white; /* Hereda el color del texto normal */
  text-decoration: none; /* Elimina el subrayado */
  font-weight: bold; /* Mantiene el negrita como el strong original */
  transition: opacity 0.3s ease; /* Efecto suave al hacer hover */
}

.phone-link {
  color: white;
}

.footer-link:hover {
  opacity: 0.8; /* Efecto sutil al pasar el mouse */
  text-decoration: underline; /* Opcional: añadir subrayado al hover */
}

/* Para dispositivos móviles (efecto al tocar) */
.footer-link:active {
  opacity: 0.6;
}

#contacto {
  background:#42220D;
  padding: 15px 20px;
  border-top: 1px solid #e0d5c8;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto 10px;
}

footer-info span {
  white-space: nowrap;
}

.copyright {
  text-align: center;
  font-size: 12px;
  color: #fcfcfc;
  padding-top: 10px;
  border-top: 1px solid #e0d5c8;
  margin-top: 10px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-info {
    flex-direction: column;
    gap: 8px;
  }

  .footer-info span {
    white-space: normal;
  }
}

.footer-column h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--gold);
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-column ul li a:hover {
  color: var(--gold);
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--primary-color);
  font-size: 2.2rem;
  transition: all 0.3s;
  text-decoration: none;
}

.social-links a:hover {
  background-color: var(--gold);
  transform: translateY(-3px);
}

/* Para dispositivos móviles (efecto al tocar) */
.footer-link:active {
  opacity: 0.6;
}


@media (max-width: 768px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
  .checkout-grid {
    grid-template-columns: 1fr;
  }
  .checkout-modal {
    width: 90%;
  }
  .cart-container {
    width: 90%;
    right: 5%;
  }
  .cart-icon {
          bottom: 15px;      /* 📍 Mantiene la posición inferior */
          right: 15px;       /* 📍 Se ajusta al borde */
          width: 55px;
          height: 55px;
  }
}


/* =========================================================
ANIMACIONES DE ENTRADA PARA PRODUCTOS
========================================================= */

/* Estado inicial: invisible y desplazado */
.menu-item {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Clase activa al entrar en pantalla */
.menu-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Efecto sutil de “rebote” al aparecer */
@keyframes bounceFade {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  60% {
    opacity: 1;
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}


/* Estilos específicos las categorías */
.menu-section {
  padding: 100px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.menu-title {
  text-align: center;
  font-family: 'Playfair Display', serif;
  color: #8B4513;
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.menu-subtitle {
  text-align: center;
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.menu-item {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid #f0f0f0;
}

.menu-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border-color: #8B4513;
}

.item-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.menu-item:hover .item-image img {
  transform: scale(1.05);
}

.item-content {
  padding: 20px;
}

.item-title {
  font-family: 'Playfair Display', serif;
  color: #8B4513;
  font-size: 1.3rem;
  margin-bottom: 8px;
  font-weight: 600;
  line-height: 1.3;
}

.item-description {
  color: #666;
  line-height: 1.4;
  margin-bottom: 12px;
  font-size: 0.9rem;
  min-height: 40px;
}

.item-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed #e0e0e0;
}

.item-price {
  color: #D2691E;
  font-size: 1.3rem;
  font-weight: bold;
}

.item-quantity {
  color: #8B4513;
  font-size: 0.85rem;
  font-weight: 500;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-btn {
  background: #8B4513;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: background 0.3s ease;
}

.quantity-btn:hover {
  background: #A0522D;
}

.quantity-display {
  font-weight: bold;
  min-width: 30px;
  text-align: center;
}

.add-to-cart-btn {
  background: #8B4513;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s ease;
  font-weight: 500;
}

.add-to-cart-btn:hover:not(:disabled) {
  background: #f29b05;
}

.add-to-cart-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.quantity-info {
  font-size: 0.8rem;
  color: #888;
  margin-top: 5px;
}

/* Estilos del carrito - MEJORADOS */
.cart-container {
  position: fixed;
  top: 100px;
  right: 20px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.2);
  width: 400px;
  max-height: 500px;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.cart-header {
  background: #8B4513;
  color: white;
  padding: 15px 20px;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-title {
  font-family: 'Playfair Display', serif;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
}

.close-cart {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.close-cart:hover {
  background: rgba(255,255,255,0.2);
}

.cart-items {
  padding: 15px;
  flex: 1;
  overflow-y: auto;
  max-height: 300px;
}

/* ESTILOS DEL CART-ITEM MEJORADOS */
.cart-item {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  width: 100%;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 6px;
  color: #8B4513;
  font-size: 1rem;
  line-height: 1.3;
}

.cart-item-details {
  font-size: 0.8rem;
  color: #666;
  width: 100%;
}

.cart-item-unit-price,
.cart-item-quantity-info,
.cart-item-subtotal {
  margin: 2px 0;
  line-height: 1.4;
}

.cart-item-subtotal {
  font-weight: bold;
  color: #D2691E;
  margin-top: 6px;
  font-size: 0.9rem;
}

.cart-item-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 5px;
}

.cart-quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-quantity-btn {
  background: #8B4513;
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.cart-quantity-btn:hover {
  background: #A0522D;
  transform: scale(1.1);
}

.remove-item {
  background: #dc3545;
  margin-left: 10px;
  width: 28px;
  height: 28px;
}

.remove-item:hover {
  background: #c82333;
  transform: scale(1.1);
}

.cart-quantity-display {
  font-weight: bold;
  min-width: 30px;
  text-align: center;
  font-size: 0.9rem;
  color: #8B4513;
}

.cart-total {
  padding: 15px 20px;
  background: #f8f8f8;
  border-top: 2px solid #e0e0e0;
  border-radius: 0 0 15px 15px;
}

.total-price {
  font-size: 1.3rem;
  font-weight: bold;
  color: #8B4513;
  text-align: center;
  margin-bottom: 15px;
}

.cart-actions {
  display: flex;
  gap: 10px;
}

.cart-action-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 25px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.clear-cart {
  background: #6c757d;
  color: white;
}

.clear-cart:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.send-whatsapp {
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.send-whatsapp:hover {
  background: #128C7E;
  transform: translateY(-2px);
}

.cart-action-btn:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.cart-icon {
        position: fixed;
        bottom: 25px;                /* 📍 Ubicado en la parte inferior */
        right: 25px;                 /* 📍 Esquina derecha */
        background: #8B4513;
        color: white;
        width: 65px;
        height: 65px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 9999;
}

.cart-icon:hover {
  background: #A0522D;
  transform: scale(1.1);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  border: 2px solid white;
}

.empty-cart-message {
  text-align: center;
  color: #666;
  padding: 30px 20px;
  font-style: italic;
  font-size: 0.9rem;
}

/* Scrollbar personalizado para el carrito */
.cart-items::-webkit-scrollbar {
  width: 6px;
}

.cart-items::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
  background: #8B4513;
  border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
  background: #A0522D;
}

/* Estados de carga y feedback */
.add-to-cart-btn.adding {
  background: #A0522D;
  position: relative;
  overflow: hidden;
}

.add-to-cart-btn.adding::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mejoras de responsive */
@media (max-width: 768px) {
  .cart-container {
    width: 95%;
    right: 2.5%;
    left: 2.5%;
    top: 90px;
    max-height: 70vh;
  }

  .cart-icon {
          bottom: 15px;      /* 📍 Mantiene la posición inferior */
          right: 15px;       /* 📍 Se ajusta al borde */
          width: 55px;
          height: 55px;
  }

  .menu-section {
    padding: 80px 15px;
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  .cart-item-controls {
    flex-direction: row;
    justify-content: space-between;
  }

  .cart-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .cart-container {
    width: 98%;
    right: 1%;
    left: 1%;
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }

  .cart-item {
    padding: 10px 0;
  }

  .cart-item-controls {
    flex-wrap: wrap;
    gap: 10px;
  }

  .cart-quantity-controls {
    order: 1;
  }

  .remove-item {
    order: 2;
    margin-left: 0;
  }
}
