:root {
  --marron: #7B5E43;
  --marron-oscuro: #4B3621;
  --beige-claro: #F5ECD9;
  --beige-medio: #E6D3B3;
  --fuente: 'Montserrat', sans-serif;
  --sombra: 0 6px 24px rgba(123, 94, 67, 0.12), 0 2px 6px rgba(75, 54, 33, 0.08);
  --sombra-hover: 0 10px 28px rgba(123, 94, 67, 0.16), 0 4px 12px rgba(75, 54, 33, 0.12);
}

body {
  margin: 0;
  font-family: var(--fuente);
  background: linear-gradient(120deg, var(--beige-claro) 0%, var(--beige-medio) 100%);
  min-height: 100vh;
  color: var(--marron-oscuro);
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(90deg, var(--marron) 85%, var(--beige-medio) 100%);
  padding: 32px 16px 16px 16px;
  color: white;
  text-align: center;
  font-size: 2rem;
  letter-spacing: 1px;
  box-shadow: 0 4px 6px rgba(123, 94, 67, 0.08);
  position: relative;
  z-index: 2;
  border-radius: 0 0 36px 36px;
  animation: fadeInHeader 1s cubic-bezier(.68,-0.55,.27,1.55);
}
header p {
  font-size: 1.1rem;
  margin: 12px 0 0 0;
  color: #f8e9cf;
  text-shadow: 0 1px 0 var(--marron);
}
@keyframes fadeInHeader {
  from { opacity:0; transform: translateY(-48px);}
  to { opacity:1; transform: translateY(0);}
}

body.modal-abierto {
  overflow: hidden !important;
  height: 100vh !important;
}

/* Nav categorías y botón subir */
.nav-categorias {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin: 14px 0 0 0;
}
.nav-categorias a {
  padding: 7px 18px;
  border-radius: 18px;
  background: var(--beige-medio);
  color: var(--marron-oscuro);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 4px #7b5e4320;
  transition: background .16s, color .16s;
}
.nav-categorias a:hover {
  background: var(--marron);
  color: var(--beige-claro);
}
#btn-volver-arriba {
  margin-left: 12px;
  padding: 8px 14px;
  border-radius: 50%;
  background: var(--marron);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 1px 6px #7b5e4320;
  transition: background .16s;
}
#btn-volver-arriba:hover {
  background: var(--marron-oscuro);
}

.contacto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 0 0 0;
  font-size: 1.08rem;
  background: transparent;
}
.contacto .btn-instagram,
.contacto .btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  color: white;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: background .21s, transform .17s;
  box-shadow: 0 2px 6px #7b5e4329;
}
.contacto .btn-instagram {
  background: linear-gradient(90deg, #f58529, #dd2a7b 60%, #8134af 90%);
}
.contacto .btn-instagram:hover {
  background: linear-gradient(90deg, #dd2a7b, #8134af 85%, #f58529 100%);
  transform: translateY(-3px) scale(1.06);
}
.contacto .btn-whatsapp {
  background: #25d366;
  color: #1B3B2E;
}
.contacto .btn-whatsapp:hover {
  background: #128C7E;
  color: #fff;
  transform: translateY(-3px) scale(1.06);
}
.icono-red {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  vertical-align: middle;
}
.btn-instagram .icono-red svg,
.btn-whatsapp .icono-red svg {
  display: block;
}

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 38px 12px 24px 12px;
  box-sizing: border-box;
}

.productos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 32px;
  animation: fadeIn 1.2s cubic-bezier(.68,-0.55,.27,1.55);
  margin: 0 auto;
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(.97) translateY(40px);}
  to { opacity: 1; transform: scale(1) translateY(0);}
}

.producto {
  background: var(--beige-claro);
  border-radius: 22px;
  box-shadow: var(--sombra);
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(.68,-0.55,.27,1.55), box-shadow 0.28s;
  cursor: pointer;
  border: 1.5px solid var(--beige-medio);
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: popIn .7s cubic-bezier(.46,1.48,.35,.93);
}
.producto:focus,
.producto:hover {
  transform: translateY(-9px) scale(1.035) rotate(-.5deg);
  box-shadow: var(--sombra-hover), 0 0 0 4px #7b5e4322;
  z-index: 1;
}
.producto::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 22px;
  pointer-events: none;
  box-shadow: 0 0 32px 0 #7B5E43cc inset;
  opacity: 0;
  transition: opacity .4s;
}
.producto:hover::after,
.producto:focus::after {
  opacity: 0.10;
}
@keyframes popIn {
  from { opacity:0; transform: scale(.85) translateY(28px);}
  to { opacity:1; transform: scale(1) translateY(0);}
}

/* Feedback visual para selección y focus */
.producto.touch, .producto.focused {
  box-shadow: var(--sombra-hover), 0 0 0 6px #7b5e4344;
  border-color: var(--marron);
}

/* Carrusel dentro de producto */
.carrusel {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 190px;
  overflow: hidden;
}
.carrusel-img {
  display: none;
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  position: absolute;
  left: 0; top: 0;
  background: var(--beige-medio);
  border-bottom: 1px solid #e6d3b3;
  padding: 24px 0 16px 0;
  margin-bottom: 0;
  transition: transform 0.25s cubic-bezier(.68,-0.55,.27,1.55);
}
.carrusel-img.activa {
  display: block;
  position: relative;
}
.carrusel-img[alt="Imagen no disponible"] {
  filter: grayscale(1) brightness(0.7);
  object-fit: contain;
}

/* FLECHAS UNIFICADAS PARA PAGINA PRINCIPAL Y MODAL */
.carrusel-prev,
.carrusel-next,
#modal-carrusel .carrusel-prev,
#modal-carrusel .carrusel-next {
  background: var(--beige-claro);
  color: var(--marron);
  border: 2px solid var(--marron);
  font-size: 2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.68,-0.55,.27,1.55);
  box-shadow: 0 4px 8px rgba(0,0,0,0.10);
  line-height: 1;
  padding: 0;
  user-select: none;
}
.carrusel-prev { left: 10px; }
.carrusel-next { right: 10px; }
#modal-carrusel .carrusel-prev { left: 10px; }
#modal-carrusel .carrusel-next { right: 10px; }
.carrusel-prev:hover,
.carrusel-next:hover,
#modal-carrusel .carrusel-prev:hover,
#modal-carrusel .carrusel-next:hover {
  background: var(--marron);
  color: var(--beige-claro);
  border-color: var(--marron-oscuro);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 18px #7b5e4344;
}

.producto-info {
  padding: 22px 18px 22px 18px;
  text-align: center;
  width: 100%;
  background: linear-gradient(90deg, var(--beige-claro) 80%, var(--beige-medio) 100%);
  background-clip: padding-box;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 2px 12px #7b5e4320;
  margin-top: -5px;
  position: relative;
  z-index: 2;
}
.producto-info .producto-titulo-precio-bg {
  background: linear-gradient(90deg, var(--beige-medio) 80%, var(--beige-claro) 100%);
  padding: 14px 12px 10px 12px;
  border-radius: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px #7b5e4320;
  display: inline-block;
  min-width: 60%;
}
.producto-info h3 {
  margin: 0 0 10px 0;
  color: var(--marron);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: 0.5px;
}
.producto-info p {
  margin: 0;
  color: var(--marron-oscuro);
  font-size: 1.12rem;
  font-weight: 500;
}

/* ==== OFERTAS ==== */
#ofertas {
  width: 100%;
  text-align: center;
  margin-bottom: 2em;
  margin-top: 1.5em;
}
#ofertas h2 {
  color: #e60026;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.8em;
  letter-spacing: 0.5px;
  text-align: center;
}
#ofertas .productos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 32px;
  justify-content: center;
  margin: 0 auto;
  max-width: 1100px;
}
#ofertas .producto {
  background: var(--beige-claro);
  border-radius: 22px;
  box-shadow: var(--sombra);
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(.68,-0.55,.27,1.55), box-shadow 0.28s;
  cursor: pointer;
  border: 1.5px solid var(--beige-medio);
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: popIn .7s cubic-bezier(.46,1.48,.35,.93);
}
#ofertas .producto-info {
  padding: 22px 18px 22px 18px;
  text-align: center;
  width: 100%;
  background: linear-gradient(90deg, var(--beige-claro) 80%, var(--beige-medio) 100%);
  background-clip: padding-box;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 2px 12px #7b5e4320;
  margin-top: -5px;
  position: relative;
  z-index: 2;
}
#ofertas .producto-info .producto-titulo-precio-bg {
  background: linear-gradient(90deg, var(--beige-medio) 80%, var(--beige-claro) 100%);
  padding: 14px 12px 10px 12px;
  border-radius: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px #7b5e4320;
  display: inline-block;
  min-width: 60%;
}
#ofertas .producto-info h3 {
  margin: 0 0 10px 0;
  color: var(--marron);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: 0.5px;
}
#ofertas .producto-info p {
  margin: 0;
  color: var(--marron-oscuro);
  font-size: 1.12rem;
  font-weight: 500;
}
.precio-anterior {
  text-decoration: line-through;
  color: #888;
  margin: 0.5em 0 0 0;
  font-size: 1.1rem;
}
.precio-oferta {
  color: #e60026;
  font-weight: bold;
  font-size: 1.3em;
  margin: 0.1em 0 0.5em 0;
}

/* MODAL MÁS GRANDE Y FOTOS MÁS VISIBLES Y PROTAGONISTAS */
.modal {
  max-width: 1100px !important;
  min-width: 340px;
  width: 97vw;
  padding: 38px 38px 38px 38px;
  font-size: 1.17rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 100;
}
.modal-carrusel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 520px;
  margin-bottom: 32px;
}
.modal-carrusel-img {
  display: block;
  width: 700px;
  max-width: 90vw;
  height: 520px;
  max-height: 70vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 20px;
  background: #f7f7fa;
  border: 2px solid #e6d3b3;
  box-shadow: 0 2px 18px #7B5E4344;
}
@media (max-width: 1100px) {
  .modal {
    max-width: 99vw !important;
    padding: 18px 2vw;
  }
  .modal-carrusel-img {
    width: 98vw;
    max-width: 98vw;
    height: 340px;
    max-height: 45vh;
  }
  .modal-carrusel {
    min-height: 340px;
  }
}
@media (max-width: 700px) {
  .modal {
    max-width: 99vw !important;
    padding: 8px 1vw;
  }
  .modal-carrusel-img {
    width: 99vw;
    max-width: 99vw;
    height: 180px;
    max-height: 32vh;
  }
  .modal-carrusel {
    min-height: 180px;
  }
}
/* FLECHAS DEL MODAL - MISMO ESTILO QUE PRINCIPAL */
#modal-carrusel .carrusel-prev,
#modal-carrusel .carrusel-next {
  background: var(--beige-claro);
  color: var(--marron);
  border: 2px solid var(--marron);
  font-size: 2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  z-index: 10;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.68,-0.55,.27,1.55);
  box-shadow: 0 4px 8px rgba(0,0,0,0.10);
  line-height: 1;
  padding: 0;
  user-select: none;
}
#modal-carrusel .carrusel-prev { left: 10px; }
#modal-carrusel .carrusel-next { right: 10px; }
#modal-carrusel .carrusel-prev:hover,
#modal-carrusel .carrusel-next:hover {
  background: var(--marron);
  color: var(--beige-claro);
  border-color: var(--marron-oscuro);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 18px #7b5e4344;
}

.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(75, 54, 33, 0.65);
  z-index: 90;
  align-items: center;
  justify-content: center;
  animation: fadeBg .33s;
}
.modal-bg.active { display: flex;}
@keyframes fadeBg { from {opacity:0;} to {opacity:1;} }

/* Descripción del modal con fondo y legibilidad */
.modal-desc-bg {
  background: linear-gradient(120deg, var(--beige-claro) 70%, var(--beige-medio) 100%);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 0 auto 18px auto;
  color: var(--marron-oscuro);
  max-width: 900px;
  font-size: 1.13rem;
  box-shadow: 0 2px 12px #7b5e4320;
  text-align: center;
  line-height: 1.5;
}
@media (max-width: 700px) {
  .modal-desc-bg {
    padding: 12px 5vw;
    font-size: 1rem;
  }
}

.modal-title-price-bg {
  background: linear-gradient(90deg, var(--beige-medio) 80%, var(--beige-claro) 100%);
  padding: 16px 24px 14px 24px;
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 16px #7b5e4326;
  display: inline-block;
  min-width: 300px;
  max-width: 90vw;
  text-align: center;
}
@media (max-width: 700px) {
  .modal-title-price-bg {
    padding: 10px 8vw 8px 8vw;
    min-width: 0;
    font-size: 1rem;
  }
}
.modal h3 {
  font-size: 1.22rem;
  margin: 0 0 10px 0;
  color: var(--marron);
  font-weight: 700;
}
.modal .desc {
  color: var(--marron-oscuro);
  font-size: 1.04rem;
  margin-bottom: 16px;
  margin-top: 0;
}
.modal .precio {
  font-size: 1.1rem;
  color: var(--marron);
  font-weight: 600;
  margin-bottom: 12px;
}
.modal button {
  padding: 8px 26px;
  border-radius: 22px;
  border: none;
  background: var(--marron);
  color: white;
  font-family: var(--fuente);
  font-size: 1rem;
  cursor: pointer;
  transition: background .22s;
  box-shadow: 0 2px 6px #7b5e4344;
}
.modal button:hover {
  background: var(--marron-oscuro);
}
.modal .cerrar {
  position: absolute;
  top: 13px; right: 13px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #7B5E43cc;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.modal .cerrar:focus { color: var(--marron-oscuro); }

footer {
  background: var(--beige-medio);
  color: var(--marron);
  padding: 18px 0;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.2px;
  border-top: 1px solid var(--beige-medio);
  margin-top: 24px;
  flex-shrink: 0;
}
footer a {
  color: var(--marron-oscuro);
  text-decoration: underline;
  font-weight: 600;
  transition: color .16s;
}
footer a:hover {
  color: var(--marron);
}

/* Responsive */
@media (max-width: 700px) {
  header {
    font-size: 1.3rem;
    padding: 22px 6px 10px 6px;
  }
  main {
    padding: 14px 2vw 14px 2vw;
  }
  .productos, #ofertas .productos {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .producto-info, #ofertas .producto-info {
    padding: 12px 4px 14px 4px;
  }
  .modal {
    padding: 22px 8px 16px 8px;
    max-width: 99vw !important;
  }
  .contacto {
    flex-direction: column;
    gap: 7px;
    font-size: 1rem;
    padding: 8px 0 0 0;
  }
  #ofertas {
    margin-bottom: 1em;
    margin-top: 0.8em;
  }
  #ofertas h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5em;
  }
  .carrusel {
    height: 140px;
  }
  .carrusel-img, .carrusel-img.activa {
    max-height: 140px;
    padding: 14px 0 8px 0;
  }
}