:root {
  /* Colores impactantes pero gourmet */
  --color-fresa: #e75480;        /* Rosa fresa intenso — comestible y vibrante */
  --color-fresa-claro: #f0a7bb;  /* Para degradados suaves */
  --color-chocolate: #5a3e36;    /* Marrón oscuro elegante (no negro) */
  --color-crema: #fdf8f3;        /* Fondo cálido y limpio */
  --color-blanco: #ffffff;
  --color-gris-suave: #f0e9e3;
  --color-verde-fresco: #6abf9c; /* Para "en stock" */
  --color-agotado: #b59d95;
}

@font-face {
  font-family: 'Cream Cake';
  src: url('fonts/CreamCake.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Fuentes */
* {
  box-sizing: border-box;
}



body {
  font-family: 'Quicksand', sans-serif;
  background-color: var(--color-crema);
  color: var(--color-chocolate);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  overflow-x: hidden; /* 🔒 Evita scroll horizontal en móvil */
}
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--color-chocolate);
}

.logo-anitacakes {
  font-family: 'Cream Cake', 'Playfair Display', serif;
  font-size: 2.3rem;
  font-weight: normal;
  line-height: 1;
}

/* Navbar personalizado */
.navbar.bg-crema {
  background-color: var(--color-blanco) !important;
  border-bottom: 1px solid rgba(90, 62, 54, 0.1);
}
.btn-fresa {
  background-color: var(--color-fresa);
  color: #000 !important;
  border: none;
}
.btn-fresa:hover {
  background-color: #d0406a;
  transform: translateY(-1px);
  color: #fff !important;
}
.btn-outline-chocolate {
  color: var(--color-chocolate);
  border-color: var(--color-chocolate);
}
.btn-outline-chocolate:hover {
  background-color: var(--color-chocolate);
  color: white;
}

/* Alertas */
.alert-success {
  background: #f8f0f2;
  border-left: 4px solid var(--color-verde-fresco);
  color: var(--color-chocolate);
}
.alert-light {
  background: var(--color-crema);
  border: 1px solid var(--color-gris-suave);
  color: var(--color-chocolate);
}

/* Contenedor principal */
.contenedor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1300px;
  margin: 20px auto;
  padding: 0 15px;
  width: 100%;
}
@media (min-width: 992px) {
  .contenedor {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}

/* Tarjetas */
#chat-container, #carrito-container {
  background: var(--color-blanco);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(90, 62, 54, 0.08);
  border: 1px solid var(--color-gris-suave);
}

/* Búsqueda */
#chat {
  width: 100%;
  padding: 12px 16px;
  margin: 15px 0 10px;
  border: 2px solid var(--color-gris-suave);
  border-radius: 12px;
  font-size: 16px;
  background: var(--color-blanco);
}
#chat:focus {
  border-color: var(--color-fresa);
  box-shadow: 0 0 0 0.25rem rgba(231, 84, 128, 0.25);
  outline: none;
}
.input-group button#enviar {
  padding: 12px 26px;
  background: var(--color-fresa);
  color: white;
  border: none;
  border-radius: 0 12px 12px 0;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  transition: background 0.3s;
}
.input-group button#enviar:hover {
  background: var(--color-chocolate);
}

/* Producto principal */
#producto-principal {
  background: linear-gradient(135deg, #fff5f7, #fdeff2);
  border: 2px solid var(--color-fresa-claro);
  padding: 22px;
  margin: 25px 0;
  border-radius: 16px;
  display: flex;
  gap: 20px;
  align-items: center;
  box-shadow: 0 4px 12px rgba(231, 84, 128, 0.1);
}
#producto-principal img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
#producto-principal h3 {
  color: var(--color-chocolate);
}

/* Sugerencias */
.similares {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 20px;
  justify-content: flex-start;
}
@media (max-width: 575.98px) {
  .similares {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .producto {
    width: 100% !important;
    max-width: 300px;
  }
}
.producto {
  border: 1px solid var(--color-gris-suave);
  padding: 18px 12px;
  width: 170px;
  text-align: center;
  border-radius: 14px;
  background: var(--color-blanco);
  box-shadow: 0 3px 8px rgba(0,0,0,0.05);
  transition: all 0.25s;
}
.producto:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(231, 84, 128, 0.15);
  border-color: var(--color-fresa-claro);
}
.producto img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 10px;
  border: 2px solid white;
}
.producto h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  height: 40px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--color-chocolate);
}
.producto .precio {
  color: var(--color-fresa);
  font-weight: 700;
  font-size: 1.15em;
}
.producto .disponible {
  color: var(--color-verde-fresco);
  font-size: 0.85em;
  font-weight: 500;
}

/* Botón Añadir */
.btn-agregar {
  background: var(--color-fresa);
  color: white;
  border: none;
  padding: 8px 0;
  border-radius: 10px;
  width: 100%;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  transition: background 0.2s;
}
.btn-agregar:hover:not(:disabled) {
  background: var(--color-chocolate);
  transform: scale(1.02);
}
.btn-agregar:disabled {
  background: var(--color-gris-suave);
  color: #a09088;
}

/* Carrito */
#carrito-titulo {
  margin-top: 0;
  padding-bottom: 10px;
  position: relative;
}
#carrito-titulo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--color-fresa);
  border-radius: 2px;
}
#lista-carrito li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-gris-suave);
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
#lista-carrito .text-truncate {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carrito-item-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid white;
  flex-shrink: 0;
}
.btn-cantidad {
  width: 32px;
  height: 32px;
  background: white;
  border: 1px solid var(--color-gris-suave);
  border-radius: 50%;
  color: var(--color-chocolate);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-cantidad:hover:not(:disabled) {
  background: var(--color-fresa);
  border-color: var(--color-fresa);
  color: white;
}
.btn-eliminar {
  background: none;
  color: #c27a8f;
  border: none;
  font-size: 1.1em;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-eliminar:hover {
  color: #a65a6e;
}
#total-carrito {
  font-weight: 800;
  margin-top: 18px;
  font-size: 1.4em;
  color: var(--color-fresa);
  padding-top: 12px;
  border-top: 1px solid var(--color-gris-suave);
}
#finalizar-compra {
  background: var(--color-fresa);
  border: none;
  padding: 12px;
  font-weight: 700;
  width: 100%;
  font-family: 'Quicksand', sans-serif;
}
#finalizar-compra:hover {
  background: var(--color-chocolate);
  transform: translateY(-2px);
}

/* Modal de imagen */
#modal-imagen {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

#modal-imagen.show {
  display: flex;
}

#modal-imagen img {
  max-width: 90%;
  max-height: 90%;
  border: 3px solid white;
  border-radius: 8px;
}

#cerrar-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
}

#cerrar-modal:hover {
  color: #f0f0f0;
}


/* ✅ TOAST RESTAURADO */
#toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--color-fresa);
  color: white;
  padding: 15px 25px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  z-index: 1060;
  display: none;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 15px;
  max-width: 350px;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-left: 4px solid var(--color-chocolate);
}
#toast.show {
  opacity: 1;
}

/* Justificación elegante para documentos legales */
.texto-justificado {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  word-break: normal;
}

/* Evitar viudas/orfanas en títulos */
.texto-justificado h2,
.texto-justificado h3,
.texto-justificado p {
  orphans: 3;
  widows: 3;
}

/* Footer */
footer {
  font-family: 'Quicksand', sans-serif;
}
footer a:hover {
  opacity: 1 !important;
  text-decoration: underline !important;
}

/* Responsive: asegurar que el carrito no se desborde en móvil */
@media (max-width: 991.98px) {
  .contenedor {
    grid-template-columns: 1fr !important;
    padding: 0 12px;
  }
  #carrito-container {
    padding: 20px 12px;
  }
}