/* Sofrito De Mi Casa A Tu Casa — estilos compartidos (index.html y pedido.html) */
:root {
  --cal: #FAFDF6;        /* fondo: blanco fresco */
  --menta: #E8F6E0;      /* superficie suave */
  --hoja: #4CC401;       /* verde del logo */
  --hoja-osc: #3AA100;
  --recao: #0E4D2A;      /* verde profundo de las letras SOFRITO */
  --tinta: #0A2E19;      /* texto */
  --aji: #E5322B;        /* rojo ají dulce */
  --girasol: #FFD23F;    /* amarillo ají maduro */
  --cielo: #A6E1EF;      /* azul de la ventanita del logo */
  --linea: rgba(14, 77, 42, .14);
  --sombra: 0 18px 40px -18px rgba(10, 46, 25, .35);

  --f-display: "Gabarito", system-ui, sans-serif;
  --f-body: "Figtree", system-ui, sans-serif;
  --f-firma: "Kaushan Script", cursive;

  --r-s: 12px;
  --r-m: 20px;
  --r-l: 32px;
  --ancho: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cal);
  color: var(--tinta);
  font: 400 18px/1.6 var(--f-body);
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); color: var(--recao); margin: 0; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(44px, 7.2vw, 92px); line-height: .95; letter-spacing: -.025em; }
h2 { font-weight: 800; font-size: clamp(34px, 4.8vw, 60px); line-height: 1; letter-spacing: -.02em; }
h3 { font-weight: 700; font-size: 24px; line-height: 1.15; }
p { margin: 0; text-wrap: pretty; }
.firma { font-family: var(--f-firma); color: var(--hoja-osc); font-size: clamp(26px, 3vw, 36px); line-height: 1.1; }
.wrap { width: min(var(--ancho), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--girasol); outline-offset: 3px; border-radius: 6px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 1.4em; border-radius: 999px; border: 0;
  font: 700 17px/1 var(--f-display); text-decoration: none; cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-wa { background: var(--hoja); color: var(--tinta); box-shadow: 0 10px 24px -12px rgba(58, 161, 0, .9); }
.btn-wa:hover { background: #5AD60C; }
.btn-linea { background: transparent; color: var(--recao); box-shadow: inset 0 0 0 2px var(--recao); }
.btn-linea:hover { background: var(--recao); color: var(--cal); }
.btn-blanco { background: #fff; color: var(--recao); }

/* Etiquetas de precio */
.precio {
  display: inline-flex; align-items: baseline; gap: .35em;
  padding: .35em .8em .3em; border-radius: 999px;
  background: #fff; box-shadow: inset 0 0 0 2px var(--linea);
  font: 600 16px/1.2 var(--f-body); color: var(--recao);
}
.precio b { font: 800 22px/1 var(--f-display); color: var(--tinta); }
.precio.rojo b { color: var(--aji); }

/* Emblema animado del logo */
.emblema { position: relative; width: var(--tam, 132px); aspect-ratio: 1; flex: none; }
.emblema video, .emblema img {
  position: absolute; inset: 7%; width: 86%; height: 86%;
  border-radius: 50%; object-fit: cover; background: #fff;
  box-shadow: 0 12px 30px -12px rgba(14, 77, 42, .45);
}
.emblema svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.emblema .aro { fill: none; stroke: var(--hoja); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 302; stroke-dashoffset: 302; }
.emblema .aro-2 { stroke: var(--girasol); stroke-width: 2; stroke-dasharray: 18 284; opacity: 0; }
/* La animación arranca cuando el logo entra en pantalla (clase .visto la pone site.js) */
.listo .emblema:not(.visto) video, .listo .emblema:not(.visto) img { opacity: 0; }
.emblema.visto .aro { animation: dibujar 1.4s .15s cubic-bezier(.65, 0, .35, 1) forwards; }
.emblema.visto .aro-2 { animation: orbita 9s 1.6s linear infinite, aparecer .4s 1.6s forwards; transform-origin: 50% 50%; }
.emblema.visto video, .emblema.visto img { animation: brotar .9s .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.emblema:hover video, .emblema:hover img { transform: rotate(-6deg) scale(1.03); transition: transform .4s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes dibujar { to { stroke-dashoffset: 0; } }
@keyframes orbita { to { transform: rotate(360deg); } }
@keyframes aparecer { to { opacity: 1; } }
@keyframes brotar { from { opacity: 0; transform: scale(.55) rotate(-18deg); } to { opacity: 1; transform: none; } }

/* Selector de cantidad */
.cantidad { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--menta); }
.cantidad button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: var(--recao); font: 800 22px/1 var(--f-display);
  transition: background-color .15s ease, transform .15s ease;
}
.cantidad button:hover { background: var(--hoja); }
.cantidad button:active { transform: scale(.9); }
.cantidad output { min-width: 2.2ch; text-align: center; font: 800 22px/1 var(--f-display); color: var(--tinta); }
.cantidad output.salta { animation: salta .3s ease; }
@keyframes salta { 40% { transform: scale(1.35); color: var(--hoja-osc); } }

/* Formulario de pedido */
.pedido-card { background: #fff; color: var(--tinta); border-radius: var(--r-l); padding: clamp(20px, 3.5vw, 36px); box-shadow: var(--sombra); }
.linea-prod { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.linea-prod h3 { font-size: 21px; }
.linea-prod p { font-size: 15px; color: #3d5a48; }
.campos { display: grid; gap: 14px; margin-top: 18px; }
.campos label { display: grid; gap: 6px; font: 600 15px/1.2 var(--f-body); color: var(--recao); }
.campos input, .campos select, .campos textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-s);
  border: 2px solid var(--linea); background: var(--cal); color: var(--tinta);
  font: 400 17px/1.3 var(--f-body);
}
.campos textarea { min-height: 84px; resize: vertical; }
.campos input:focus, .campos select:focus, .campos textarea:focus { outline: none; border-color: var(--hoja); background: #fff; }
.total { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 16px; font: 600 17px/1 var(--f-body); }
.total strong { font: 800 40px/1 var(--f-display); color: var(--recao); }
.aviso { min-height: 1.4em; margin-top: 10px; font-size: 15px; color: var(--aji); font-weight: 600; }
.pedido-card .btn { width: 100%; }
.nota-pie { margin-top: 12px; font-size: 14px; color: #4f6b5a; text-align: center; }
.nota-pie a { color: var(--recao); font-weight: 600; }

/* Burbujas de opiniones (vienen de WhatsApp) */
.burbuja {
  position: relative; margin: 0; background: #fff; padding: 16px 18px 12px; border-radius: 18px 18px 18px 4px;
  box-shadow: 0 6px 18px -10px rgba(10, 46, 25, .35); font-size: 17px; line-height: 1.45;
}
.burbuja footer { margin-top: 8px; font-size: 13px; color: #5b7766; }

/* Botón flotante de WhatsApp */
.wa-flotante {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  height: 62px; min-width: 62px; padding: 0 15px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; gap: 0;
  background: var(--hoja); color: var(--tinta); text-decoration: none;
  box-shadow: 0 14px 30px -10px rgba(10, 46, 25, .55);
  transform: translateY(120px); transition: transform .35s cubic-bezier(.2, 1.2, .4, 1), gap .35s ease, background-color .2s ease;
}
.wa-flotante.visible { transform: none; }
.wa-flotante:hover { background: #5AD60C; }
.wa-flotante svg { width: 32px; height: 32px; flex: none; }
.wa-texto { max-width: 0; overflow: hidden; white-space: nowrap; font: 800 17px/1 var(--f-display); transition: max-width .45s cubic-bezier(.2, 1, .3, 1); }
.wa-cuenta { position: absolute; top: -6px; right: -4px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--aji); color: #fff; font: 800 14px/1 var(--f-display); box-shadow: 0 0 0 3px var(--cal); }
.wa-cuenta:empty { display: none; }
.wa-flotante.con-pedido { gap: 10px; padding-right: 22px; animation: llamar .6s cubic-bezier(.2, 1.4, .4, 1); }
.wa-flotante.con-pedido .wa-texto { max-width: 240px; }
@keyframes llamar { 40% { transform: scale(1.12); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .emblema .aro { stroke-dashoffset: 0; }
}
