/* ===========================
   Miga Lab Bakery — estilos
   =========================== */

:root {
  --cream: #F8F3EC;
  --sand: #EBDFD0;
  --sand-2: #E2D2BF;
  --brown-300: #B89474;
  --brown-500: #8A5D3B;
  --brown-700: #5B3A27;
  --brown-900: #2B1C14;
  --red: #B0252C;
  --red-dark: #8E1B21;

  --text: var(--brown-900);
  --muted: #7A6556;
  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(43, 28, 20, .25);

  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.accent { color: var(--red); font-style: italic; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brown-500); margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: var(--red); }
.eyebrow--light { color: var(--sand-2); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .9em 1.6em; border-radius: 999px; border: 1.5px solid var(--brown-900);
  background: var(--brown-900); color: var(--cream);
  font: 500 .95rem var(--font-sans); text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { background: var(--red); border-color: var(--red); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--brown-900); }
.btn--ghost:hover { background: var(--brown-900); border-color: var(--brown-900); color: var(--cream); }
.btn--small { padding: .55em 1.2em; font-size: .85rem; }
.btn--block { width: 100%; background: var(--red); border-color: var(--red); }
.btn--block:hover { background: var(--red-dark); border-color: var(--red-dark); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.is-scrolled { border-color: var(--sand); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--brown-900); }
.logo__mark { width: 32px; height: 32px; color: var(--brown-700); }
.logo__dot { fill: var(--red); }
.logo__text { font-family: var(--font-serif); font-size: 1.3rem; margin: 0; }
.logo__text em { font-style: italic; color: var(--red); }
.nav__links { display: flex; align-items: center; gap: 2rem; }
.nav__links a:not(.btn) { text-decoration: none; font-size: .92rem; color: var(--brown-700); position: relative; }
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 1.5px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.nav__links a:not(.btn):hover::after { transform: scaleX(1); }
.nav__toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; padding: 10px 8px; }
.nav__toggle span { display: block; height: 1.5px; background: var(--brown-900); margin: 6px 0; transition: transform .25s; }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

/* HERO */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 8vw, 7rem); }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 2.5rem; }
.hero__facts { list-style: none; padding: 0; margin: 0; display: flex; gap: 2.5rem; border-top: 1px solid var(--sand-2); padding-top: 1.5rem; }
.hero__facts strong { display: block; font-family: var(--font-serif); font-size: 1.6rem; font-weight: 400; color: var(--brown-700); }
.hero__facts span { font-size: .82rem; color: var(--muted); }
.hero__art { position: relative; justify-self: center; width: min(420px, 100%); }
.hero__circle {
  aspect-ratio: 1; border-radius: 50%; background: var(--sand);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.hero__circle::before {
  content: ""; position: absolute; inset: 18px; border-radius: 50%;
  border: 1px dashed var(--brown-300); opacity: .7;
}
.hero__cake { width: 68%; animation: float 6s ease-in-out infinite; }
.hero__badge {
  position: absolute; right: 2%; top: 8%;
  width: 92px; height: 92px; border-radius: 50%; background: var(--red); color: var(--cream);
  display: grid; place-items: center; text-align: center;
  font: italic 500 1rem/1.1 var(--font-serif); transform: rotate(-10deg); box-shadow: var(--shadow);
}
@keyframes float { 50% { transform: translateY(-8px); } }

/* SECCIONES */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section--alt { background: var(--sand); }
.section--dark { background: var(--brown-900); color: var(--cream); }
.section__head { max-width: 620px; margin-bottom: 2.5rem; }

/* FILTROS */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.chip {
  border: 1px solid var(--sand-2); background: transparent; color: var(--brown-700);
  padding: .5em 1.1em; border-radius: 999px; font: 500 .85rem var(--font-sans); cursor: pointer;
  transition: all .2s;
}
.chip:hover { border-color: var(--brown-500); }
.chip.is-active { background: var(--brown-700); border-color: var(--brown-700); color: var(--cream); }

/* PRODUCTOS */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card {
  background: #fff; border: 1px solid var(--sand); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card.is-hidden { display: none; }
.card__img {
  aspect-ratio: 4/3; background: var(--sand); display: grid; place-items: center; position: relative;
}
.card__img svg { width: 42%; color: var(--brown-700); }
.card__tag {
  position: absolute; top: 12px; left: 12px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  background: var(--cream); color: var(--brown-700); padding: .3em .8em; border-radius: 999px;
}
.card__tag--red { background: var(--red); color: var(--cream); }
.card__body { padding: 1.3rem 1.3rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.card__body h3 { margin-bottom: .3rem; }
.card__body p { font-size: .9rem; color: var(--muted); flex: 1; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .5rem; }
.price { font-family: var(--font-serif); font-size: 1.25rem; color: var(--brown-700); }
.price small { font-family: var(--font-sans); font-size: .75rem; color: var(--muted); }
.price__old { display: block; font-size: .85rem; line-height: 1.2; color: var(--muted); text-decoration-color: var(--red); }
.card__promo { color: var(--red) !important; font-weight: 500; flex: 0 !important; margin-top: -.4rem; }
.flavor { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.flavor span { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.flavor select { padding: .6em .8em; cursor: pointer; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--sand-2); border-radius: 999px; }
.qty button {
  width: 34px; height: 34px; border: 0; background: none; cursor: pointer; font-size: 1.1rem; color: var(--brown-700);
  border-radius: 50%; transition: background .2s, color .2s;
}
.qty button:hover { background: var(--red); color: var(--cream); }
.qty output { min-width: 22px; text-align: center; font-weight: 600; font-size: .9rem; }
.add-btn {
  border: 1.5px solid var(--brown-900); background: transparent; color: var(--brown-900);
  padding: .5em 1.1em; border-radius: 999px; font: 500 .85rem var(--font-sans); cursor: pointer; transition: all .2s;
}
.add-btn:hover { background: var(--red); border-color: var(--red); color: var(--cream); }

/* PASOS */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.step { background: var(--cream); padding: 2rem; border-radius: var(--radius); }
.step__num { display: block; font-family: var(--font-serif); font-size: 2.4rem; color: var(--red); margin-bottom: 1rem; line-height: 1; }
.step p { color: var(--muted); margin: 0; }

/* NOSOTROS */
.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 4rem; align-items: center; }
.about__panel {
  aspect-ratio: 4/5; border-radius: var(--radius); background: var(--brown-700);
  display: flex; flex-direction: column; justify-content: flex-end; gap: .2rem; padding: 2rem;
  position: relative; overflow: hidden;
}
.about__panel::before {
  content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  top: -15%; right: -20%; background: var(--brown-500); opacity: .6;
}
.about__panel span { position: relative; font-family: var(--font-serif); font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--sand); line-height: 1.2; }
.about__panel span:nth-child(2) { color: var(--red); font-style: italic; filter: brightness(1.4); }
.about__copy p { font-size: 1.05rem; }

/* PEDIDO */
.order { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.order__intro > p { color: var(--sand-2); }
.cart { margin-top: 2rem; border: 1px solid rgba(235, 223, 208, .2); border-radius: var(--radius); padding: 1.5rem; }
.cart__title { font-size: 1.1rem; }
.cart__list { list-style: none; margin: 0; padding: 0; }
.cart__list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed rgba(235, 223, 208, .2); font-size: .92rem; }
.cart__list li span:first-child b { color: var(--sand); font-weight: 600; }
.cart__list li.cart__discount { color: #ff8a8f; }
.cart__remove { background: none; border: 0; color: var(--brown-300); cursor: pointer; margin-left: .5rem; font-size: 1rem; }
.cart__remove:hover { color: #ff6b70; }
.cart__empty { color: var(--brown-300); font-size: .9rem; margin: 0; }
.cart__empty a { color: var(--sand); }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 1rem; padding-top: .5rem; }
.cart__total strong { font-family: var(--font-serif); font-weight: 400; font-size: 1.6rem; color: var(--cream); }

.form { background: var(--cream); color: var(--text); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { font-size: .82rem; font-weight: 500; color: var(--brown-700); }
input, select, textarea {
  font: 400 .95rem var(--font-sans); color: var(--text);
  background: #fff; border: 1px solid var(--sand-2); border-radius: 10px; padding: .8em .9em;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brown-500); box-shadow: 0 0 0 3px rgba(138, 93, 59, .15); }
input.is-invalid { border-color: var(--red); }
textarea { resize: vertical; }
.form__error { color: var(--red); font-size: .85rem; min-height: 1.2em; margin: 0 0 .6rem; }
.form__hint { font-size: .8rem; color: var(--muted); text-align: center; margin: .8rem 0 0; }

/* FOOTER */
.footer { background: var(--brown-900); color: var(--cream); padding: 3rem 0 1.5rem; border-top: 1px solid rgba(235, 223, 208, .12); }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer .muted { color: var(--brown-300); font-size: .9rem; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--cream); text-decoration: underline; }
.footer__label { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .5rem; color: var(--sand-2); }
.footer__copy { font-size: .8rem; color: var(--brown-300); margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(235, 223, 208, .12); }

/* Flotante + toast */
.floating {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  display: none; justify-content: space-between; align-items: center;
  background: var(--red); color: var(--cream); text-decoration: none;
  padding: .9rem 1.3rem; border-radius: 999px; box-shadow: var(--shadow);
}
.floating strong { font-family: var(--font-serif); font-weight: 400; font-size: 1.1rem; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 70;
  background: var(--brown-900); color: var(--cream); padding: .75rem 1.3rem; border-radius: 999px;
  font-size: .9rem; box-shadow: var(--shadow); transition: transform .35s ease; pointer-events: none;
}
.toast.is-visible { transform: translate(-50%, 0); }

/* Revelado al hacer scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .order, .about { grid-template-columns: 1fr; gap: 2.5rem; }
  .about__panel { aspect-ratio: 16/10; }
}
@media (max-width: 760px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 1px solid var(--sand); padding: .5rem 16px 1.2rem;
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .25s;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a:not(.btn) { padding: .8rem 0; border-bottom: 1px solid var(--sand); }
  .nav__links .btn { margin-top: 1rem; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__art { order: -1; width: min(300px, 80%); }
  .hero__facts { gap: 1.5rem; }
  .steps { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .floating:not([hidden]) { display: flex; }
  body.has-floating .toast { bottom: 84px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
