/* =========================================================
   SJTS – Estilos
   Los colores principales están en :root. Cámbialos para
   ajustar la marca cuando tengas el logo definitivo.
   ========================================================= */
:root {
  --bg: #fbf6ef;
  --surface: #ffffff;
  --tint: #f4ebe0;
  --ink: #2b2220;
  --muted: #6f625c;
  --line: #e7dccf;
  --accent: #d9653b;
  --accent-dark: #b44f2a;
  --whatsapp: #1f9d55;
  --dark: #2b2220;

  /* Color de cada sector */
  --c-velas: #f2c6b4;
  --c-cuadernos: #c9d8c5;
  --c-papeleria: #f3dc9f;
  --c-vasos: #c4d4ea;
  --c-camisas: #e6c9de;
  --c-ropa: #d8cdbd;

  --radius: 16px;
  --shadow: 0 2px 10px rgba(43, 34, 32, .06), 0 12px 30px rgba(43, 34, 32, .06);
  --font-title: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
p { margin: 0 0 1em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .6em; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px; border-radius: 999px; border: 2px solid transparent; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s, background .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.btn--whatsapp { background: var(--whatsapp); color: #fff; }
.btn--whatsapp:hover { background: #17824a; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; position: relative; font-size: 1.1rem; }
.icon-btn:hover { background: var(--tint); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px; margin-inline: auto; display: block; }

/* ---------- Encabezado ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(251, 246, 239, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { font-family: var(--font-title); font-weight: 700; font-size: 1.7rem; letter-spacing: .04em; text-decoration: none; display: flex; align-items: center; }
.brand img { height: 58px; width: auto; }
.nav { display: flex; gap: 28px; }
.nav a { text-decoration: none; font-weight: 500; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.topbar__actions { display: flex; gap: 4px; }
.cart-count { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.cart-count.bump { animation: bump .3s; }
@keyframes bump { 50% { transform: scale(1.35); } }
.menu-btn { display: none; }

/* ---------- Portada ---------- */
.hero { padding: 56px 0 72px; }
.hero__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); }
.hero h1 em { color: var(--accent); font-style: italic; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero__art { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tile { aspect-ratio: 1; border-radius: 24px; display: grid; place-items: center; overflow: hidden; }
.tile svg { width: 46%; height: 46%; }
.tile img { width: 100%; height: 100%; object-fit: cover; animation: aparecer .4s ease; }
@keyframes aparecer { from { opacity: 0; } }
.tile--a { background: var(--c-velas); border-radius: 24px 24px 24px 120px; }
.tile--b { background: var(--c-vasos); transform: translateY(28px); }
.tile--c { background: var(--c-camisas); }
.tile--d { background: var(--c-cuadernos); transform: translateY(28px); border-radius: 120px 24px 24px 24px; }

/* ---------- Secciones ---------- */
.section { padding: 80px 0; }
.section--tint { background: var(--tint); }
.section--dark { background: var(--dark); color: var(--bg); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.section__head h2 { margin: 0; }
.section__head p { margin: 0; color: var(--muted); }

/* ---------- Sectores ---------- */
.sectors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sector { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 200px; padding: 24px; border-radius: var(--radius); border: 0; text-align: left; cursor: pointer; background: var(--sc, var(--tint)); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.sector:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.sector h3 { font-size: 1.5rem; margin: 0 0 .2em; position: relative; }
.sector p { margin: 0; color: rgba(43, 34, 32, .75); position: relative; max-width: 24ch; }
.sector__count { position: relative; font-weight: 700; font-size: .85rem; }
.sector__icon { position: absolute; right: -10px; bottom: -14px; width: 130px; height: 130px; opacity: .55; transition: transform .3s; }
.sector:hover .sector__icon { transform: rotate(-8deg) scale(1.06); }

/* ---------- Filtros ---------- */
.filters { display: grid; gap: 16px; margin-bottom: 28px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; }
.chip:hover { border-color: var(--ink); }
.chip[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters__row { display: flex; gap: 12px; flex-wrap: wrap; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); }
.search:focus-within { border-color: var(--ink); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { border: 0; outline: 0; background: transparent; padding: 12px 0; width: 100%; }
select { padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }

/* ---------- Productos ---------- */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s; }
.card:hover { transform: translateY(-3px); }
.card__media { position: relative; aspect-ratio: 4 / 3.4; background: var(--sc, var(--tint)); display: grid; place-items: center; cursor: pointer; border: 0; padding: 0; width: 100%; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media svg { width: 42%; height: 42%; }
.badge { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .9); font-size: .72rem; font-weight: 700; }
.card__body { padding: 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__sector { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.card__title { font-family: var(--font-title); font-size: 1.15rem; margin: 0; }
.card__desc { color: var(--muted); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; }
.price { font-weight: 700; font-size: 1.1rem; }
.card__add { padding: 9px 16px; font-size: .9rem; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Cómo pedir ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.steps li { background: var(--surface); padding: 24px; border-radius: var(--radius); }
.steps span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 14px; }
.steps h3 { font-size: 1.25rem; }
.steps p { color: var(--muted); margin: 0; }

/* ---------- Nosotros ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about p { color: var(--muted); font-size: 1.05rem; }
.about .about__lema { font-family: var(--font-title); font-style: italic; font-size: 1.3rem; color: var(--accent); line-height: 1.35; }
.about .about__cierre { color: var(--ink); font-weight: 700; margin-top: 1.4em; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.perks li { display: grid; gap: 2px; padding: 18px 20px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; }
.perks span { color: var(--muted); }

/* ---------- Contacto ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.contact p { color: #d8ccc4; }
.contact__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.contact__list li { display: flex; gap: 12px; align-items: baseline; padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.contact__list strong { min-width: 90px; color: #f2c6b4; font-weight: 500; }
.contact__list a { color: var(--bg); }

.footer { background: #1f1816; color: #a99b93; font-size: .9rem; }
.footer__inner { display: flex; justify-content: space-between; padding: 20px 0; gap: 12px; flex-wrap: wrap; }
.footer a { color: #a99b93; }

/* ---------- Modal ---------- */
.modal { border: 0; padding: 0; border-radius: 20px; width: min(860px, 100% - 32px); max-height: calc(100dvh - 32px); background: var(--surface); color: var(--ink); }
.modal::backdrop { background: rgba(43, 34, 32, .5); }
.modal__inner { display: grid; grid-template-columns: 1fr 1fr; position: relative; }
.modal__close { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255, 255, 255, .85); }
.modal__media { position: relative; overflow: hidden; background: var(--sc, var(--tint)); min-height: 420px; }
.modal__media > svg { position: absolute; inset: 0; margin: auto; width: 45%; height: 45%; }
/* Galería de fotos del producto (se desliza con el dedo) */
.gallery { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.88); cursor: pointer; font-size: 1.2rem; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 1; }
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }
.gallery__dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; z-index: 1; }
.gallery__dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(43,34,32,.3); }
.gallery__dots span.on { background: var(--ink); }
.card__count { position: absolute; bottom: 10px; right: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(43,34,32,.75); color: #fff; font-size: .72rem; font-weight: 700; }
.modal__body { padding: 32px 28px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.modal__body h3 { font-size: 1.6rem; margin: 0; }
.modal__body > p:not(.eyebrow):not(.price) { color: var(--muted); }
.option { margin-bottom: 14px; }
.option__label { font-weight: 700; font-size: .9rem; margin-bottom: 6px; display: block; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills label { padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; }
.pills input:checked + label { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pills input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: grid; gap: 4px; font-size: .88rem; font-weight: 700; margin-bottom: 10px; }
.field input, .field textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 400; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--ink); }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 16px; font-weight: 700; font-size: .9rem; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; }
.qty button { width: 34px; height: 34px; border: 0; background: none; cursor: pointer; font-size: 1.1rem; }
.qty input { width: 42px; border: 0; text-align: center; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- Carrito ---------- */
.overlay { position: fixed; inset: 0; background: rgba(43, 34, 32, .45); z-index: 40; }
.cart { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--bg); z-index: 50; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s ease; box-shadow: -10px 0 40px rgba(0, 0, 0, .15); }
.cart.open { transform: none; }
.cart__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cart__head h3 { margin: 0; font-size: 1.4rem; }
.cart__items { flex: 1; overflow-y: auto; padding: 8px 20px; }
.cart__empty { text-align: center; color: var(--muted); padding: 48px 0; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line__thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--sc, var(--tint)); display: grid; place-items: center; overflow: hidden; }
.line__thumb img { width: 100%; height: 100%; object-fit: cover; }
.line__thumb svg { width: 60%; height: 60%; }
.line__name { font-weight: 700; font-size: .95rem; margin: 0; }
.line__meta { color: var(--muted); font-size: .82rem; margin: 2px 0 6px; }
.line__right { display: flex; flex-direction: column; align-items: end; justify-content: space-between; }
.line .qty button { width: 28px; height: 28px; }
.line .qty span { min-width: 22px; text-align: center; font-size: .9rem; }
.remove { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .8rem; text-decoration: underline; padding: 0; }
.cart__foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: var(--surface); max-height: 60dvh; overflow-y: auto; }
.cart__total { display: flex; justify-content: space-between; font-size: 1.2rem; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: .82rem; margin-bottom: 12px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; z-index: 60; transition: transform .3s; font-weight: 500; max-width: calc(100% - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Recordatorio de carrito ---------- */
.cart-reminder { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 35; width: min(520px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border-radius: 16px; background: var(--surface); box-shadow: 0 10px 40px rgba(43, 34, 32, .25); border: 1.5px solid var(--accent); animation: subir .35s ease; }
.cart-reminder p { margin: 0; flex: 1; font-weight: 500; font-size: .95rem; }
.cart-reminder__icon { font-size: 1.5rem; }
.cart-reminder .btn--sm { padding: 8px 14px; font-size: .88rem; white-space: nowrap; }
@keyframes subir { from { transform: translate(-50%, 30px); opacity: 0; } }

/* ---------- Unidades disponibles ---------- */
.stock { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: .82rem; font-weight: 700; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock--ok { color: #17603a; }
.stock--low { color: #a15c00; }
.stock--out { color: #b42318; }
.card.is-out .card__media { filter: grayscale(.7); opacity: .75; }

/* ---------- Cuenta y precios protegidos ---------- */
.account-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 500; max-width: 180px; }
.account-btn:hover { border-color: var(--ink); }
.account-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.account-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn.is-in { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.price-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 22px; margin-bottom: 24px; border-radius: var(--radius); background: #fff4ec; border: 1.5px dashed var(--accent); }
.price-notice strong { display: block; }
.price-notice span { color: var(--muted); font-size: .92rem; }
.price-notice__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.price-notice .btn { padding: 10px 18px; }
.price-lock { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent-dark); font-weight: 700; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }
.price-lock svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.price-wait { color: var(--muted); font-size: .9rem; }
.modal--auth { width: min(440px, 100% - 32px); }
.auth { position: relative; padding: 36px 28px 28px; }
.auth h3 { font-size: 1.7rem; margin-bottom: .2em; }
.auth__panel { display: flex; flex-direction: column; gap: 2px; }
.auth__panel[hidden] { display: none; }
.auth .muted, .muted { color: var(--muted); }
.auth__error { color: #b42318; font-size: .88rem; min-height: 1.2em; margin: 2px 0 8px; }
.auth__ok { background: #e8f5ec; color: #17603a; padding: 10px 14px; border-radius: 10px; font-size: .92rem; }
.auth__switch { text-align: center; color: var(--muted); font-size: .9rem; margin: 10px 0 0; }
.auth .btn--block + .btn--block { margin-top: 8px; }
.link-btn.inline { display: inline; padding: 0; margin: 0; color: var(--accent-dark); font-weight: 700; }

/* ---------- Adaptación a pantallas ---------- */
@media (max-width: 560px) {
  .account-btn { padding: 0 10px; }
  .account-btn span { display: none; }
}
@media (max-width: 900px) {
  .sectors { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about, .contact { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .nav { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 16px; border-top: 1px solid var(--line); }
  .hero { padding: 32px 0 56px; }
  .hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .hero__art { max-width: 380px; }
  .section { padding: 56px 0; }
  .modal__inner { grid-template-columns: 1fr; }
  .modal { overflow-y: auto; }
  .modal__media { min-height: 0; height: min(80vw, 46dvh); }
  .modal__body { overflow: visible; padding: 22px 20px 24px; }
  .gallery__nav { display: none; }
}
@media (max-width: 520px) {
  .sectors { grid-template-columns: 1fr; }
  .sector { min-height: 150px; }
  .steps { grid-template-columns: 1fr; }
  .products { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card__body { padding: 12px; }
  .card__title { font-size: 1rem; }
  .card__desc { display: none; }
  .card__foot { flex-direction: column; align-items: stretch; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
