/* Panel The Natural Way — mismo ADN de la tienda (css/estilos.css): verde noche, lima, crema. Celular primero. */
:root {
  --noche: #0b1d10; --bosque: #12301a; --hoja: #2c6a36; --lima: #a8cf3d; --lima-2: #c4e46a; --lima-osc: #5f8a14;
  --crema: #f6f3ea; --papel: #fffdf7; --tinta: #13201a; --gris: #5b685e; --linea: #e3dfd2; --rojo: #b3261e;
  --radio: 18px; --sombra: 0 10px 30px -14px rgba(11, 29, 16, .35);
  --fuente-titulo: 'Baloo 2', 'Nunito Sans', system-ui, sans-serif;
  --fuente: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --barra: calc(68px + env(safe-area-inset-bottom));
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--fuente); font-size: 16px; line-height: 1.5; color: var(--tinta); background: var(--crema); }
img { display: block; max-width: 100%; }
h1, h2 { font-family: var(--fuente-titulo); line-height: 1.1; margin: 0 0 .3em; }
h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); }
:focus-visible { outline: 3px solid var(--lima); outline-offset: 2px; border-radius: 8px; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app { min-height: 100dvh; }
.cargando { width: 44px; height: 44px; margin: 40vh auto 0; border-radius: 50%; border: 4px solid var(--linea); border-top-color: var(--hoja); animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- botones ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 0; font: 800 1rem var(--fuente); text-decoration: none; cursor: pointer;
  transition: transform .15s, background .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primario { background: linear-gradient(135deg, var(--lima-2), var(--lima)); color: var(--noche); box-shadow: 0 8px 20px -10px rgba(111, 154, 28, .9); }
.btn-suave { background: var(--papel); color: var(--bosque); border: 1.5px solid var(--linea); }
.btn-peligro { background: var(--rojo); color: #fff; }
.btn-texto { background: none; color: var(--hoja); min-height: 44px; padding: 0 8px; text-decoration: underline; }
.btn-texto.peligro { color: var(--rojo); margin: 28px auto 0; display: flex; }
.btn-bloque { width: 100%; }
.btn-icono { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(168, 207, 61, .12); color: var(--lima-2); cursor: pointer; }

/* ---------- entrada ---------- */
.entrar {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom)); color: var(--crema); text-align: center;
}
body:has(.entrar) { background: radial-gradient(120% 80% at 50% 0%, var(--hoja) 0%, var(--bosque) 45%, var(--noche) 100%); }
.entrar-logo { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; box-shadow: 0 0 0 3px var(--lima), 0 20px 40px -10px rgba(168, 207, 61, .45); animation: flotar 5s ease-in-out infinite; }
@keyframes flotar { 50% { transform: translateY(-6px); } }
.kicker { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--lima); margin: 0 0 6px; }
.entrar .bajada { color: rgba(246, 243, 234, .8); }
.form-entrar { display: grid; gap: 14px; margin-top: 18px; text-align: left; }
.form-entrar .campo span { color: rgba(246, 243, 234, .85); }
.form-entrar input { background: rgba(255, 253, 247, .96); }
.entrar .nota { font-size: .88rem; color: rgba(246, 243, 234, .65); margin-top: 18px; }
.entrar .error { color: #ffb4a9; }

/* ---------- campos ---------- */
.campo { display: grid; gap: 6px; }
.campo > span { font-weight: 800; font-size: .92rem; color: var(--bosque); }
.campo small { color: var(--gris); font-size: .82rem; }
input, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--linea);
  background: #fff; color: var(--tinta); font: 600 16px var(--fuente); /* 16px: iPhone no hace zoom */
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus { outline: none; border-color: var(--hoja); box-shadow: 0 0 0 4px rgba(168, 207, 61, .3); }
input[readonly] { background: #eef0e6; }
.error { color: var(--rojo); font-weight: 700; margin: 4px 0 0; min-height: 0; }
.error:empty { display: none; }

/* ---------- marco ---------- */
.cabeza {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(11, 29, 16, .95); color: var(--crema);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cabeza-marca { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; color: inherit; }
.cabeza-marca img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px var(--lima); }
.cabeza-marca span { font-family: var(--fuente-titulo); font-weight: 800; font-size: 1.05rem; line-height: 1; }
.cabeza-marca small { display: block; font: 700 .68rem var(--fuente); color: var(--lima); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr);
  height: var(--barra); padding-bottom: env(safe-area-inset-bottom); background: var(--papel); border-top: 1px solid var(--linea);
  box-shadow: 0 -10px 30px -20px rgba(11, 29, 16, .5);
}
.barra-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--gris); text-decoration: none; font-size: .78rem; font-weight: 800; }
.barra-item[aria-current="page"] { color: var(--hoja); }
.barra-item[aria-current="page"] .barra-icono { background: rgba(168, 207, 61, .25); }
.barra-icono { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .2s; }
.barra-item.central .barra-icono { width: 54px; height: 54px; margin-top: -26px; background: linear-gradient(135deg, var(--lima-2), var(--lima)); color: var(--noche); box-shadow: 0 10px 22px -8px rgba(95, 138, 20, .9), 0 0 0 5px var(--crema); }
.contenido { padding: 20px 16px calc(var(--barra) + 32px); max-width: 980px; margin: 0 auto; }
.solo-pc { display: none; }

/* ---------- vistas ---------- */
.vista-angosta { max-width: 640px; margin: 0 auto; }
.vista-cabeza { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.bajada { color: var(--gris); margin: 0 0 12px; }
.ayuda { color: var(--gris); font-size: .88rem; margin: 6px 0 14px; }
.volver { display: inline-flex; align-items: center; min-height: 44px; color: var(--hoja); font-weight: 800; text-decoration: none; }
.ver-tienda { display: inline-block; margin: -2px 0 14px; color: var(--hoja); font-weight: 700; }
.vacio { text-align: center; padding: 48px 16px; color: var(--gris); }

.productos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.producto {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 10px; background: var(--papel); border-radius: var(--radio);
  border: 1px solid var(--linea); box-shadow: var(--sombra); animation: entrar .35s both;
}
.producto:nth-child(2) { animation-delay: .04s; } .producto:nth-child(3) { animation-delay: .08s; } .producto:nth-child(n+4) { animation-delay: .12s; }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } }
.producto.oculto { opacity: .6; }
.producto-enlace { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: inherit; min-height: 72px; }
.producto-enlace img { width: 72px; height: 72px; flex: none; object-fit: contain; border-radius: 14px; background: linear-gradient(160deg, #fff, #eef3e0); }
.producto-info { display: grid; gap: 3px; min-width: 0; }
.producto-info strong { font-size: 1rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.producto-precios { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .8rem; color: var(--gris); font-weight: 700; }
.producto-precios span { white-space: nowrap; }
.etiquetas { display: flex; gap: 6px; flex-wrap: wrap; }
.etiquetas:empty { display: none; }
.etq { font-style: normal; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(44, 106, 54, .12); color: var(--hoja); }
.etq.lima { background: var(--lima); color: var(--noche); }
.etq.gris { background: #e5e2d8; color: var(--gris); }
.producto-ojo { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--gris); }
.interruptor { position: relative; width: 52px; height: 32px; border-radius: 999px; border: 0; background: #cfcabb; cursor: pointer; transition: background .2s; flex: none; }
.interruptor span { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s; }
.interruptor.encendido { background: var(--hoja); }
.interruptor.encendido span { transform: translateX(20px); }
.interruptor::after { content: ''; position: absolute; inset: -6px; } /* área de toque 44 px */

.tarjeta-panel { border: 1px solid var(--linea); background: var(--papel); border-radius: var(--radio); padding: 16px; margin: 0 0 14px; display: grid; gap: 14px; box-shadow: var(--sombra); min-width: 0; }
.tarjeta-panel legend { float: left; width: 100%; padding: 0; font-family: var(--fuente-titulo); font-weight: 800; font-size: 1.2rem; color: var(--bosque); }
.tarjeta-panel legend + * { clear: both; }
.precios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.precios input { padding: 12px 10px; font-weight: 800; }
.precio-pista { margin: 0; }

.foto-bloque { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start; }
.foto-bloque + .foto-bloque { border-top: 1px dashed var(--linea); padding-top: 14px; }
.foto-vista { position: relative; width: 112px; height: 112px; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, #fff, #eef3e0); display: grid; place-items: center; border: 1px solid var(--linea); }
.foto-vista img { width: 100%; height: 100%; object-fit: contain; }
.foto-vista.afiche img { object-fit: cover; }
.foto-vista.subiendo img { opacity: .35; }
.foto-sin { color: var(--gris); font-size: .8rem; font-weight: 700; }
.foto-estado { position: absolute; inset: auto 0 0; padding: 6px; background: var(--noche); color: var(--lima); font-size: .75rem; font-weight: 800; text-align: center; }
.foto-texto { display: grid; gap: 4px; min-width: 0; }
.foto-texto small { color: var(--gris); font-size: .82rem; }
.foto-texto .pendiente { color: var(--lima-osc); font-weight: 700; }
.fila-botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.fila-botones .btn { min-height: 44px; padding: 0 14px; font-size: .9rem; }

.chip-check { position: relative; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check input, .check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--linea); background: #fff; font-weight: 700; cursor: pointer; transition: all .15s; }
.chip-check input:checked + span { background: var(--bosque); color: var(--crema); border-color: var(--bosque); }
.chip-check input:focus-visible + span, .check input:focus-visible + span { outline: 3px solid var(--lima); outline-offset: 2px; }
.check { position: relative; display: flex; align-items: center; min-height: 48px; cursor: pointer; }
.check span { display: grid; padding-left: 64px; position: relative; }
.check span::before { content: ''; position: absolute; left: 0; top: 50%; translate: 0 -50%; width: 52px; height: 32px; border-radius: 999px; background: #cfcabb; transition: background .2s; }
.check span::after { content: ''; position: absolute; left: 4px; top: 50%; translate: 0 -50%; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s; }
.check input:checked + span::before { background: var(--hoja); }
.check input:checked + span::after { transform: translateX(20px); }
.check small { color: var(--gris); font-size: .82rem; }
.guardar-fijo { position: sticky; bottom: calc(var(--barra) + 10px); z-index: 5; display: grid; gap: 6px; padding: 10px; margin: 0 -6px; border-radius: 22px; background: rgba(246, 243, 234, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* ---------- avisos y hojas ---------- */
.aviso {
  position: fixed; left: 50%; bottom: calc(var(--barra) + 16px); z-index: 60; translate: -50% 20px; opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--noche); color: var(--crema); font-weight: 700;
  box-shadow: var(--sombra); transition: opacity .25s, translate .25s; border-left: 4px solid var(--lima);
}
.aviso.visible { opacity: 1; translate: -50% 0; }
.aviso[data-tipo="error"] { border-left-color: #ff6b5e; }
.hoja { border: 0; border-radius: 24px; padding: 22px; width: min(420px, calc(100% - 24px)); background: var(--papel); color: var(--tinta); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.hoja::backdrop { background: rgba(11, 29, 16, .55); backdrop-filter: blur(2px); }
.hoja p { color: var(--gris); }
.hoja-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* ---------- PC: la barra sube debajo de la cabecera ---------- */
@media (min-width: 900px) {
  :root { --barra: 0px; }
  .barra { position: sticky; top: 64px; bottom: auto; height: 56px; display: flex; justify-content: center; gap: 8px; box-shadow: none; }
  .barra-item { flex-direction: row; gap: 8px; padding: 0 18px; font-size: .95rem; }
  .barra-item.central .barra-icono { width: 30px; height: 30px; margin: 0; box-shadow: none; }
  .barra-icono { width: 40px; }
  .solo-pc { display: inline-flex; }
  .guardar-fijo { bottom: 12px; }
  .contenido { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
