/* Yulay's · Catálogo público. Colores del logo: crema, verde copa y verde hoja. */
:root {
  --crema: #f7f9ef;
  --papel: #ffffff;
  --copa: #bbd897;
  --copa-claro: #e6f0d4;
  --hoja: #4f8238;
  --hoja-oscuro: #2f5a22;
  --tinta: #1f2a1b;
  --suave: #5e6a57;
  --linea: #e2e8d5;
  --error: #b3261e;
  --sombra: 0 6px 18px rgba(47, 90, 34, .10);
  --radio: 18px;
  --abajo: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--crema); color: var(--tinta); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
body.sin-scroll { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--hoja); outline-offset: 2px; }
.suave { color: var(--suave); }
.error { color: var(--error); font-weight: 600; margin: .5rem 0 0; min-height: 1em; }

/* ---------- Cabecera ---------- */
.cabecera { text-align: center; padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1.25rem .5rem; }
.logo { width: 132px; height: 132px; margin: 0 auto; border-radius: 28px; }
.mensaje { max-width: 34rem; margin: .4rem auto 0; color: var(--suave); }
.aviso-cerrado { max-width: 34rem; margin: .75rem auto 0; padding: .6rem .9rem; border-radius: 12px; background: #fff4d6; color: #7a5200; font-weight: 600; }

/* ---------- Buscador y categorías (quedan fijos arriba) ---------- */
.herramientas { position: sticky; top: 0; z-index: 10; background: var(--crema); padding: .6rem 0 .5rem; border-bottom: 1px solid var(--linea); }
.buscar { display: block; width: calc(100% - 2.5rem); max-width: 40rem; margin: 0 auto; min-height: 46px; padding: .55rem 1rem;
  border: 1.5px solid var(--linea); border-radius: 999px; background: var(--papel); }
.buscar:focus { outline: none; border-color: var(--hoja); box-shadow: 0 0 0 3px var(--copa-claro); }
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: .6rem 1.25rem .1rem; scrollbar-width: none; max-width: 72rem; margin: 0 auto; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .3rem; min-height: 40px; padding: 0 1rem; border-radius: 999px;
  border: 1.5px solid var(--linea); background: var(--papel); font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--hoja); border-color: var(--hoja); color: #fff; }
.chip-verde { border-color: var(--copa); background: var(--copa-claro); color: var(--hoja-oscuro); }
.chip-verde[aria-pressed="true"] { background: var(--hoja-oscuro); border-color: var(--hoja-oscuro); color: #fff; }
.hoja { width: 16px; height: 16px; fill: currentColor; flex: 0 0 auto; }

/* ---------- Productos ---------- */
main { max-width: 72rem; margin: 0 auto; padding: 0 1rem 1.5rem; }
.seccion { margin-top: 1.6rem; }
.seccion h2 { font-size: 1.35rem; margin: 0 .25rem .75rem; color: var(--hoja-oscuro); letter-spacing: -.01em; }
.grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
@media (min-width: 640px) { .grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } }
@media (min-width: 980px) { .grilla { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.producto { display: flex; flex-direction: column; background: var(--papel); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); }
.producto.es-verde { box-shadow: 0 0 0 2px var(--copa), var(--sombra); }
.foto { position: relative; aspect-ratio: 1; background: var(--copa-claro); }
.img-producto { width: 100%; height: 100%; object-fit: cover; }
.img-producto.sin-foto { display: grid; place-items: center; }
.img-producto.sin-foto img { width: 55%; opacity: .55; mix-blend-mode: multiply; }
/* La etiqueta de precio: como la de un puesto de mercado */
.precio { position: absolute; left: .55rem; bottom: .55rem; padding: .25rem .65rem .25rem 1.05rem; border-radius: 6px 999px 999px 6px;
  background: var(--hoja); color: #fff; font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.precio::before { content: ""; position: absolute; left: .4rem; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--crema); }
.sello-verde { position: absolute; top: .55rem; right: .55rem; display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .55rem;
  border-radius: 999px; background: rgba(255,255,255,.92); color: var(--hoja-oscuro); font-size: .75rem; font-weight: 700; }
.texto { flex: 1; padding: .7rem .8rem .2rem; }
.texto h3 { margin: 0; font-size: 1rem; line-height: 1.25; }
.desc, .incluye { margin: .3rem 0 0; font-size: .85rem; color: var(--suave); }
.incluye { color: var(--hoja-oscuro); }
.agregar { margin: .6rem .8rem .8rem; min-height: 42px; border: 0; border-radius: 12px; background: var(--copa-claro); color: var(--hoja-oscuro); font-weight: 700; cursor: pointer; }
.agregar:hover { background: var(--copa); }
.agregar:active { transform: scale(.98); }

.vacio { text-align: center; padding: 3rem 1rem; color: var(--suave); }
.vacio-titulo { font-size: 1.2rem; font-weight: 700; color: var(--tinta); }
.contactos { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1rem; }
.btn-wa { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border-radius: 999px; background: #1f9d55; color: #fff; font-weight: 700; text-decoration: none; }
.pie { text-align: center; color: var(--suave); font-size: .85rem; padding: .5rem 1rem calc(6rem + var(--abajo)); }

/* ---------- Barra del pedido ---------- */
.barra-pedido { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: .6rem 1rem calc(.6rem + var(--abajo));
  background: linear-gradient(to top, var(--crema) 70%, rgba(247, 249, 239, 0)); }
.ver-pedido { display: flex; align-items: center; gap: .75rem; width: 100%; max-width: 34rem; margin: 0 auto; min-height: 56px; padding: 0 1.1rem;
  border: 0; border-radius: 999px; background: var(--hoja-oscuro); color: #fff; font-weight: 700; font-size: 1.05rem; cursor: pointer; box-shadow: var(--sombra); }
.ver-pedido span:nth-child(2) { flex: 1; text-align: left; }
.burbuja { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 .4rem; border-radius: 999px; background: var(--copa); color: var(--hoja-oscuro); }

/* ---------- Hoja inferior ---------- */
.velo { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(31, 42, 27, .45); }
.hoja-inferior { display: flex; flex-direction: column; width: 100%; max-width: 34rem; max-height: 92vh; background: var(--papel); border-radius: 22px 22px 0 0; animation: subir .22s ease-out; }
@media (min-width: 700px) { .velo { align-items: center; } .hoja-inferior { border-radius: 22px; } }
@keyframes subir { from { transform: translateY(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .hoja-inferior { animation: none; } }
.hoja-cabeza { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem .4rem; }
.hoja-cabeza h2 { margin: 0; font-size: 1.2rem; }
.cerrar { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--crema); cursor: pointer; font-size: 1rem; }
.hoja-cuerpo { padding: .3rem 1.1rem 1rem; overflow-y: auto; }
.hoja-pie { padding: .75rem 1.1rem calc(.9rem + var(--abajo)); border-top: 1px solid var(--linea); }
.principal { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 0 1rem; border: 0; border-radius: 999px;
  background: var(--hoja); color: #fff; font-weight: 700; font-size: 1.02rem; cursor: pointer; text-decoration: none; text-align: center; }
.principal.enviar { background: #1f9d55; }
.principal:disabled { opacity: .6; }

.capa { border: 0; padding: 0; margin: 0 0 1rem; }
.capa-titulo { font-weight: 700; margin: 0 0 .35rem; padding: 0; }
.opcion { display: flex; align-items: center; gap: .65rem; min-height: 48px; padding: 0 .8rem; margin-bottom: .4rem; border: 1.5px solid var(--linea); border-radius: 12px; cursor: pointer; }
.opcion:has(input:checked) { border-color: var(--hoja); background: var(--copa-claro); }
.opcion input { width: 20px; height: 20px; accent-color: var(--hoja); }
.opciones-linea { display: flex; flex-wrap: wrap; gap: .5rem; }
.opciones-linea .opcion { flex: 1 1 140px; margin: 0; }

.lineas { list-style: none; margin: 0; padding: 0; }
.lineas li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--linea); }
.linea-texto { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.linea-texto .suave { font-size: .85rem; }
.cantidad { display: flex; align-items: center; gap: .4rem; }
.cantidad button { width: 38px; height: 38px; border: 1.5px solid var(--linea); border-radius: 50%; background: var(--papel); font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.cantidad span { min-width: 1.5rem; text-align: center; font-weight: 700; }
.total { display: flex; justify-content: space-between; font-size: 1.15rem; margin: .8rem 0 1rem; }
.formulario { border-top: 1px dashed var(--linea); padding-top: .8rem; }
.campo { border: 0; padding: 0; margin: 0 0 .9rem; }
.campo > label, .campo legend { display: block; font-weight: 700; margin-bottom: .3rem; padding: 0; }
.campo input[type=text], .campo textarea { width: 100%; min-height: 46px; padding: .55rem .8rem; border: 1.5px solid var(--linea); border-radius: 12px; background: var(--papel); }
.campo input:focus, .campo textarea:focus { outline: none; border-color: var(--hoja); box-shadow: 0 0 0 3px var(--copa-claro); }
.ayuda { margin: .25rem 0 0; font-size: .82rem; color: var(--suave); }
.confirmacion { text-align: center; padding: .5rem 0 1rem; }
.codigo { font-size: 2.4rem; font-weight: 800; color: var(--hoja-oscuro); margin: .2rem 0 .5rem; letter-spacing: .06em; }

/* ---------- Estado (cargando, error) y aviso ---------- */
.estado-pagina { min-height: 80vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: .3rem; padding: 2rem 1.25rem; color: var(--suave); }
.estado-pagina h1 { color: var(--tinta); font-size: 1.3rem; margin: .5rem 0 0; }
.logo-estado { width: 110px; height: 110px; border-radius: 24px; }
.estado-pagina .principal { width: auto; padding: 0 1.5rem; margin-top: .5rem; }
#aviso { position: fixed; left: 50%; bottom: calc(5.5rem + var(--abajo)); z-index: 40; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  padding: .55rem 1rem; border-radius: 999px; background: var(--tinta); color: #fff; font-weight: 600; transition: opacity .2s, transform .2s; }
#aviso.visible { opacity: 1; transform: translate(-50%, 0); }
