/* ============================================================
   Librería Quiroz — estilos
   ============================================================ */

:root {
  --ink: #2b2350;
  --ink-soft: #5a5378;
  --paper: #fdf9f0;
  --card: #ffffff;
  /* acentos unificados: el rosa y azul del degradé de las tarjetas */
  --accent: #ff2288;
  --accent-dark: #d61b73;
  --blue: #387ef0;
  --sun: #ffc93c;
  --mint: #387ef0; /* ahora apunta al azul de la paleta */
  --line: #ece5d8;
  /* superficies claras para tarjetas y buscador */
  --surface-dark: #ffffff;
  --surface-darker: #ffffff;
  --shadow: 0 8px 24px rgba(43, 35, 80, 0.08);
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

h1, h2, h3, .logo { font-family: "Baloo 2", "Nunito", sans-serif; }

img { max-width: 100%; }

.container { width: min(1100px, 92%); margin: 0 auto; }

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 249, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.logo {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .badge {
  background: var(--sun);
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 1.2rem;
}

nav { display: flex; gap: 22px; }

nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

nav a:hover { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.menu-toggle {
  display: none;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.menu-toggle:hover { border-color: var(--accent); color: var(--accent); }

.login-btn {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font: 800 0.9rem "Nunito", sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.login-btn:hover { border-color: var(--accent); color: var(--accent); }

.cart-btn {
  position: relative;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font: 700 0.95rem "Nunito", sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s;
}

.cart-btn:hover { transform: scale(1.04); }

.cart-count {
  background: #fff;
  color: var(--accent);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}

/* ---------- Hero: "cuaderno escolar vivo" ---------- */
.hero {
  position: relative;
  padding: 64px 0 0;
  overflow: hidden;
  /* hoja cuadriculada */
  background-image:
    linear-gradient(rgba(56, 126, 240, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 126, 240, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 85% 15%, rgba(255, 201, 60, 0.18), transparent 45%),
    radial-gradient(circle at 10% 85%, rgba(255, 34, 136, 0.07), transparent 40%);
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  padding-bottom: 56px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* cinta washi con el dato del local */
.washi {
  display: inline-block;
  background: repeating-linear-gradient(-45deg, var(--sun) 0 12px, #ffd95e 12px 24px);
  color: var(--ink);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 8px 20px;
  margin-bottom: 22px;
  transform: rotate(-1.5deg);
  box-shadow: 0 3px 10px rgba(43, 35, 80, 0.15);
  /* bordes dentados de cinta cortada */
  clip-path: polygon(0 0, 100% 0, 98% 25%, 100% 50%, 98% 75%, 100% 100%, 0 100%, 2% 75%, 0 50%, 2% 25%);
}

.hero h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  line-height: 1.1;
  margin-bottom: 6px;
}

/* palabra rotativa */
.swap {
  display: inline-flex;
  height: 1.18em;
  overflow: hidden;
  vertical-align: bottom;
}

.swap-list {
  display: flex;
  flex-direction: column;
  animation: swap-words 9s infinite cubic-bezier(0.75, 0, 0.25, 1);
}

.swap-list span {
  height: 1.18em;
  line-height: 1.18;
  white-space: nowrap;
  color: var(--accent);
}

@keyframes swap-words {
  0%, 19%   { transform: translateY(0); }
  25%, 44%  { transform: translateY(-1.18em); }
  50%, 69%  { transform: translateY(-2.36em); }
  75%, 94%  { transform: translateY(-3.54em); }
  100%      { transform: translateY(-4.72em); }
}

/* palabra resaltada con "fibrón" */
.marker {
  font-style: normal;
  position: relative;
  z-index: 0;
  padding: 0 6px;
}

.marker::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 12% -2% 6% -2%;
  background: var(--sun);
  border-radius: 6px 14px 8px 12px;
  transform: rotate(-1.5deg) scaleX(0);
  transform-origin: left center;
  animation: marker-swipe 0.7s 0.5s ease-out forwards;
}

@keyframes marker-swipe { to { transform: rotate(-1.5deg) scaleX(1); } }

/* subrayado que se dibuja solo */
.squiggle {
  width: min(260px, 60%);
  color: var(--accent);
  margin: 2px 0 14px;
}

.squiggle path {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: draw-line 1.2s 0.9s ease-out forwards;
}

@keyframes draw-line { to { stroke-dashoffset: 0; } }

.hero p { color: var(--ink-soft); font-size: 1.1rem; margin-bottom: 28px; max-width: 46ch; }

.hero .hl {
  background: linear-gradient(transparent 55%, rgba(56, 126, 240, 0.28) 55%);
  font-weight: 800;
  color: var(--ink);
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ----- escena: libreta espiralada + útiles flotando ----- */
.hero-scene { position: relative; min-height: 380px; }

.notebook {
  position: relative;
  width: min(320px, 100%);
  margin: 24px auto 0;
  background:
    linear-gradient(90deg, rgba(255, 34, 136, 0.25) 0 2px, transparent 2px) 34px 0 / 100% 100% no-repeat,
    repeating-linear-gradient(#fff 0 30px, #dbe7fb 30px 31px);
  background-color: #fff;
  border-radius: 8px 8px 16px 16px;
  padding: 42px 26px 30px 48px;
  box-shadow: 0 18px 40px rgba(43, 35, 80, 0.22);
  transform: rotate(3deg);
  animation: notebook-sway 7s ease-in-out infinite;
}

@keyframes notebook-sway {
  0%, 100% { transform: rotate(3deg) translateY(0); }
  50%      { transform: rotate(2deg) translateY(-8px); }
}

.spiral {
  position: absolute;
  top: -13px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
}

.spiral i {
  width: 13px;
  height: 26px;
  border: 3.5px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 -4px 0 rgba(255, 255, 255, 0.35);
}

.nb-title {
  font-family: "Caveat", cursive;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 30px;
  margin-bottom: 0;
}

.todo { list-style: none; }

.todo li {
  font-family: "Caveat", cursive;
  font-size: 1.45rem;
  font-weight: 600;
  color: #3f3a63;
  line-height: 31px;
  position: relative;
  padding-left: 30px;
}

.todo li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--mint);
  font-weight: 900;
  opacity: 0;
  transform: scale(2) rotate(-20deg);
  animation: check-pop 0.4s ease-out forwards;
}

.todo li:nth-child(1)::before { animation-delay: 1.1s; }
.todo li:nth-child(2)::before { animation-delay: 1.7s; }
.todo li:nth-child(3)::before { animation-delay: 2.3s; }
.todo li:nth-child(4)::before { animation-delay: 2.9s; }

@keyframes check-pop {
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.tag {
  position: absolute;
  bottom: -22px;
  left: -30px;
  background: var(--accent);
  color: #fff;
  font: 900 0.9rem/1.25 "Nunito", sans-serif;
  text-align: center;
  padding: 12px 18px;
  border-radius: 12px;
  transform: rotate(-7deg);
  box-shadow: 0 10px 24px rgba(255, 34, 136, 0.4);
}

.tag::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 44px;
  height: 14px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 2px;
}

/* útiles flotando */
.float-el {
  position: absolute;
  font-size: 2.2rem;
  filter: drop-shadow(0 6px 8px rgba(43, 35, 80, 0.2));
  animation: floaty 6s ease-in-out infinite;
}

.f1 { top: 2%;   left: 4%;   font-size: 2.6rem; animation-delay: 0s;    }
.f2 { top: 12%;  right: 2%;  animation-delay: 1.2s; animation-duration: 7s; }
.f3 { bottom: 30%; left: -2%; animation-delay: 2s;   }
.f4 { top: 45%;  right: -1%; font-size: 2.5rem; animation-delay: 0.6s; animation-duration: 8s; }
.f5 { bottom: 2%; right: 12%; animation-delay: 1.6s; }
.f6 { top: -4%;  left: 42%;  animation-delay: 2.6s; animation-duration: 7.5s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-16px) rotate(8deg); }
}

/* ----- marquee ----- */
.marquee {
  background: var(--sun);
  transform: rotate(-1.2deg) scale(1.04);
  padding: 12px 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(43, 35, 80, 0.12);
}

.marquee-track {
  display: flex;
  gap: 40px;
  width: max-content;
  animation: marquee-scroll 24s linear infinite;
}

.marquee-track span {
  color: var(--ink);
  font: 800 0.95rem "Nunito", sans-serif;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 40px;
}

.marquee-track span::after { content: "✦"; color: var(--accent); }

@keyframes marquee-scroll {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .swap-list, .notebook, .float-el, .marquee-track,
  .white::before, .border::before, .darkBorderBg::before,
  .glow::before, .filterBorder::before { animation: none; }
  .marker::after { animation: none; transform: rotate(-1.5deg) scaleX(1); }
  .squiggle path { animation: none; stroke-dashoffset: 0; }
  .todo li::before { animation: none; opacity: 1; transform: none; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font: 800 1rem "Nunito", sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(255, 34, 136, 0.35); }
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }

.hero-art {
  background: linear-gradient(135deg, #fff4d6, #ffe3d3);
  border-radius: 28px;
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow);
}

.hero-art .big { font-size: 5rem; line-height: 1; }

.hero-art .row { font-size: 2.4rem; letter-spacing: 12px; margin-top: 18px; }

.hero-art p { margin-top: 18px; font-weight: 800; color: var(--ink); }

/* ---------- Secciones ---------- */
section { padding: 56px 0; }

.section-head { text-align: center; margin-bottom: 36px; }

.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.section-head p { color: var(--ink-soft); margin-top: 6px; }

/* ---------- Filtros ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
}

.chip {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 18px;
  font: 800 0.9rem "Nunito", sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover { border-color: var(--accent); color: var(--accent); }

.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Buscador estilo Uiverse.io (by Lakshay-art) ----------
   Adaptado: los anillos de degradé conic giran SIEMPRE (en el
   original la animación estaba comentada y solo giraba con hover). */
#poda {
  position: relative;
  width: 314px;
  height: 70px;
  flex-basis: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.white,
.border,
.darkBorderBg,
.glow {
  max-height: 70px;
  max-width: 314px;
  height: 100%;
  width: 100%;
  position: absolute;
  inset: 0;
  margin: auto;
  overflow: hidden;
  z-index: -1;
  border-radius: 12px;
  filter: blur(3px);
}

.input {
  background-color: var(--surface-darker);
  border: none;
  width: 301px;
  height: 56px;
  border-radius: 10px;
  color: var(--ink);
  padding-inline: 59px;
  font: 600 17px "Nunito", sans-serif;
}

.input::placeholder { color: var(--ink-soft); }

.input:focus { outline: none; }

#main { position: relative; }

#pink-mask {
  pointer-events: none;
  width: 30px;
  height: 20px;
  position: absolute;
  background: #ff2288;
  top: 10px;
  left: 5px;
  filter: blur(20px);
  opacity: 0.8;
  transition: all 2s;
}

#main:hover > #pink-mask { opacity: 0; }

.white {
  max-height: 63px;
  max-width: 307px;
  border-radius: 10px;
  filter: blur(2px);
}

.white::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(83deg);
  position: absolute;
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: brightness(1.4);
  background-image: conic-gradient(
    rgba(0, 0, 0, 0) 0%,
    #a099d8,
    rgba(0, 0, 0, 0) 8%,
    rgba(0, 0, 0, 0) 50%,
    #dfa2da,
    rgba(0, 0, 0, 0) 58%
  );
  animation: rotate 4s linear infinite;
}

.border {
  max-height: 59px;
  max-width: 303px;
  border-radius: 11px;
  filter: blur(0.5px);
}

.border::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(70deg);
  position: absolute;
  width: 600px;
  height: 600px;
  filter: brightness(1.3);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    #e9e2f5,
    #387ef0 5%,
    #e9e2f5 14%,
    #e9e2f5 50%,
    #ff2288 60%,
    #e9e2f5 64%
  );
  animation: rotate 4s 0.1s linear infinite;
}

.darkBorderBg { max-height: 65px; max-width: 312px; }

.darkBorderBg::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(82deg);
  position: absolute;
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    rgba(0, 0, 0, 0),
    #9db9f5,
    rgba(0, 0, 0, 0) 10%,
    rgba(0, 0, 0, 0) 50%,
    #f5a0cd,
    rgba(0, 0, 0, 0) 60%
  );
  animation: rotate 4s 0.2s linear infinite;
}

.glow {
  overflow: hidden;
  filter: blur(30px);
  opacity: 0.4;
  max-height: 130px;
  max-width: 354px;
}

.glow::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(60deg);
  position: absolute;
  width: 999px;
  height: 999px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(
    #fdf9f0,
    #387ef0 5%,
    #fdf9f0 38%,
    #fdf9f0 50%,
    #ff2288 60%,
    #fdf9f0 87%
  );
  animation: rotate 4s 0.3s linear infinite;
}

@keyframes rotate {
  100% { transform: translate(-50%, -50%) rotate(450deg); }
}

#filter-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  max-height: 40px;
  max-width: 38px;
  height: 100%;
  width: 100%;
  isolation: isolate;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f3eefc, #e9e2f5);
  border: 1px solid #e5dcf2;
  cursor: pointer;
}

.filterBorder {
  height: 42px;
  width: 40px;
  position: absolute;
  overflow: hidden;
  top: 7px;
  right: 7px;
  border-radius: 10px;
}

.filterBorder::before {
  content: "";
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  position: absolute;
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: brightness(1.35);
  background-image: conic-gradient(
    rgba(0, 0, 0, 0),
    #c9bfe0,
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 0) 50%,
    #c9bfe0,
    rgba(0, 0, 0, 0) 100%
  );
  animation: rotate 4s linear infinite;
}

#search-icon {
  position: absolute;
  left: 20px;
  top: 16px;
  pointer-events: none;
}

/* ---------- Grilla de productos ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface-dark);
  border-radius: var(--radius);
  padding: 3px;
  display: flex;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(43, 35, 80, 0.14);
  transition: transform 0.15s;
}

.card:hover { transform: translateY(-4px); }

.card .content {
  position: relative;
  z-index: 1;
  isolation: isolate;
  border-radius: 13px;
  overflow: hidden;
  background-color: #fff;
  background-image:
    /* velo blanco difuminado que baja el brillo */
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)),
    linear-gradient(to bottom, #fe58, 90%, #0002),
    conic-gradient(
      at 60% 50%,
      #ccc,
      #ff6bfe,
      #00f9f8,
      #ddd,
      #0081fd,
      #eef0bc,
      #0081fd,
      #ff6bfe,
      #0002,
      #0081fd,
      #ddd,
      #01fefb,
      #ccc
    );
  flex: 1;
  padding: 16px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Capas holográficas (Uiverse.io by dexter-st, solo fondo + animación) */
.card .content::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle at 70% 20%, #f0f, #0000),
    repeating-radial-gradient(circle at 30% 80%, #fff, #f4a 48px, #eeeeee 150px);
  mix-blend-mode: color-burn;
  filter: blur(10px);
  opacity: 0.22;
}

.card .content::after {
  content: "";
  position: absolute;
  inset: -20px;
  background: linear-gradient(to bottom, #f205, #f00, #0f0, #f205);
  mix-blend-mode: difference;
  animation: holo-shift 3s ease-in-out infinite alternate;
  background-position: 0 0;
  background-size: 100% 300%;
  background-repeat: repeat;
  filter: blur(10px);
  opacity: 0.18;
}

@keyframes holo-shift {
  to { background-position: 0 500px; }
}

.card .content > * {
  position: relative;
  z-index: 1;
}

.card .content > .low-badge { position: absolute; }

.card .thumb {
  background: linear-gradient(135deg, #fff7e0, #ffeadd);
  border-radius: 12px;
  height: 110px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  overflow: hidden;
}

.card .thumb img,
.thumb-sm img,
.admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* stock */
.low-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 900;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.card.is-out .content { opacity: 0.65; }

.soldout-label {
  background: #f1edff;
  color: #8b83ab;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: 10px;
}

.card .cat {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.card h3 {
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.card .desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  flex: 1;
}

.card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.card .price {
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.add-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font: 800 0.85rem "Nunito", sans-serif;
  cursor: pointer;
}

.add-btn:hover { background: var(--accent-dark); }

.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  border-radius: 10px;
  padding: 4px;
}

.qty-ctrl button {
  background: transparent;
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  font: 900 1rem "Nunito", sans-serif;
  cursor: pointer;
}

.qty-ctrl span { color: #fff; font-weight: 800; min-width: 18px; text-align: center; }

.empty-msg { text-align: center; color: var(--ink-soft); padding: 40px 0; font-weight: 700; }

/* ---------- Cómo comprar ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.step .icon { font-size: 2.6rem; }

.step .icon svg {
  width: 2.6rem;
  height: 2.6rem;
  vertical-align: middle;
}

.step .num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--sun);
  font-weight: 900;
  margin: 12px 0 8px;
}

.step h3 { margin-bottom: 6px; }

.step p { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- Ubicación ---------- */
.location {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 28px;
  align-items: stretch;
}

.loc-info {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.loc-info h3 { font-size: 1.3rem; }

.loc-row { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-soft); }

.loc-row .ico { font-size: 1.3rem; }

.loc-row strong { color: var(--ink); }

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-height: 320px;
}

.map-wrap iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }

/* ---------- Carrito (drawer) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 35, 80, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 90;
}

.overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: #fff;
  z-index: 100;
  transform: translateX(105%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(43, 35, 80, 0.18);
}

.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h3 { font-size: 1.25rem; }

.close-btn {
  background: var(--paper);
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink);
}

.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; }

.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.cart-item .thumb-sm {
  background: linear-gradient(135deg, #fff7e0, #ffeadd);
  border-radius: 10px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.cart-item .info { flex: 1; }

.cart-item .info h4 { font-size: 0.92rem; line-height: 1.2; }

.cart-item .info .p { font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; }

.cart-item .qty-ctrl { padding: 3px; }

.cart-item .qty-ctrl button { width: 24px; height: 24px; font-size: 0.9rem; }

.remove-btn { background: none; border: none; color: #c33; cursor: pointer; font-size: 1rem; }

.drawer-foot { padding: 18px 22px; border-top: 1px solid var(--line); }

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 14px;
}

.drawer-foot .btn { width: 100%; justify-content: center; }

.cart-empty { text-align: center; color: var(--ink-soft); padding: 50px 10px; }

.cart-empty .big { font-size: 3rem; }

/* ---------- Checkout (modal) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(43, 35, 80, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal.open { opacity: 1; pointer-events: auto; }

.modal-box {
  background: #fff;
  border-radius: 20px;
  width: min(480px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 26px;
}

.modal-box h3 { font-size: 1.35rem; margin-bottom: 4px; }

.modal-box .sub { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 18px; }

.field { margin-bottom: 14px; }

.field label { display: block; font-weight: 800; font-size: 0.88rem; margin-bottom: 6px; }

.field input, .field textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  font: 600 0.95rem "Nunito", sans-serif;
  outline: none;
  color: var(--ink);
}

.field input:focus, .field textarea:focus { border-color: var(--accent); }

.field-hint { font-weight: 700; font-size: 0.78rem; color: var(--ink-soft); }

/* Selector de categorías con casillas tipo pastilla (elegí una o varias) */
.cat-checks { display: flex; flex-wrap: wrap; gap: 8px; }

.cat-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 14px;
  font: 800 0.85rem "Nunito", sans-serif;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.cat-check:hover { border-color: var(--accent); color: var(--accent); }

.cat-check input { width: auto; margin: 0; accent-color: var(--accent); cursor: pointer; }

.cat-check:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pay-options { display: grid; gap: 10px; margin-bottom: 14px; }

.pay-opt {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  transition: border-color 0.15s;
}

.pay-opt:has(input:checked) { border-color: var(--accent); background: #fff2f8; }

.pay-opt input { margin-top: 4px; accent-color: var(--accent); }

.pay-opt .t { font-weight: 800; font-size: 0.95rem; }

.pay-opt .d { font-size: 0.83rem; color: var(--ink-soft); }

.alias-box {
  display: none;
  background: #f4f0ff;
  border: 2px dashed #b9a8f5;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.alias-box.show { display: block; }

.alias-box strong { font-size: 1.05rem; letter-spacing: 0.03em; }

.wa-btn {
  width: 100%;
  justify-content: center;
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
}

.wa-btn:hover { background: #1eb757; }

/* ---------- Login y panel de stock ---------- */
.form-error { color: #d61b3c; font-weight: 800; font-size: 0.88rem; min-height: 1.2em; margin-bottom: 8px; }

.form-hint {
  background: #fff8e1;
  border: 1px dashed var(--sun);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.admin-box { width: min(680px, 100%); }

.admin-sub {
  font-family: "Baloo 2", sans-serif;
  font-size: 1.05rem;
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.form-grid .span-2 { grid-column: 1 / -1; }

.form-grid input[type="file"] {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  font: 600 0.85rem "Nunito", sans-serif;
  background: #fff;
  color: var(--ink-soft);
}

.img-preview { margin-top: 8px; }

.img-preview img {
  max-height: 110px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.admin-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.admin-form-actions .btn { padding: 11px 20px; font-size: 0.92rem; }

.admin-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fffdf8;
}

.admin-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7e0, #ffeadd);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
}

.admin-info { flex: 1; min-width: 0; }

.admin-info strong { display: block; font-size: 0.92rem; line-height: 1.2; }

.admin-info small { color: var(--ink-soft); font-weight: 700; }

.stock-zero { color: #d61b3c; }

.mini-btn {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font: 800 0.85rem "Nunito", sans-serif;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.mini-btn:hover { border-color: var(--accent); color: var(--accent); }

.mini-btn.danger:hover { border-color: #d61b3c; color: #d61b3c; }

.admin-empty { text-align: center; padding: 20px 0; color: var(--ink-soft); font-weight: 700; }

.admin-empty .btn { margin-top: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: 0 10px 26px rgba(43, 35, 80, 0.18);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  z-index: 120;
  transition: transform 0.25s;
}

.toast.show { transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
footer {
  background: #fff;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 36px 0;
  margin-top: 30px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

footer .logo { color: var(--ink); }

footer p { font-size: 0.88rem; }

/* ---------- Utilidades ---------- */
.muted { color: var(--ink-soft); font-size: 0.9rem; }
.admin-link { color: var(--accent); font-weight: 800; }
.admin-link:hover { text-decoration: underline; }

/* ---------- Reseñas (home) ---------- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.review-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(43, 35, 80, 0.06);
}

.review-stars { color: var(--sun); font-size: 1.1rem; letter-spacing: 2px; margin-bottom: 8px; }
.review-text { font-size: 0.98rem; line-height: 1.5; margin-bottom: 10px; }
.review-author { font-weight: 800; font-size: 0.9rem; }
.review-author span { color: var(--ink-soft); font-weight: 600; }

.review-form-box {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.review-form-box h3 { font-size: 1.25rem; margin-bottom: 4px; }
.review-form-box textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  margin: 12px 0 4px;
  resize: vertical;
}
.review-form-box textarea:focus { border-color: var(--accent); outline: none; }

.star-picker { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.star-btn {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #d8d2e6;
  cursor: pointer;
  transition: transform 0.1s, color 0.1s;
}
.star-btn:hover { transform: scale(1.15); }
.star-btn.on { color: var(--sun); }

/* ---------- Cuenta de cliente ---------- */
.auth-switch { text-align: center; margin-top: 14px; font-size: 0.9rem; color: var(--ink-soft); }
.auth-switch button {
  background: none; border: none; color: var(--accent);
  font: inherit; font-weight: 800; cursor: pointer; padding: 0;
}
.auth-switch button:hover { text-decoration: underline; }

.account-email { color: var(--ink-soft); font-weight: 700; font-size: 0.92rem; }

.orders-empty { text-align: center; padding: 24px 0; color: var(--ink-soft); font-weight: 700; }
.orders-empty .big { font-size: 2.6rem; margin-bottom: 8px; }

#ordersList { display: flex; flex-direction: column; gap: 12px; max-height: 380px; overflow-y: auto; }

.order-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--paper);
}
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.order-id { font-weight: 900; font-size: 0.95rem; }
.order-date { color: var(--ink-soft); font-size: 0.82rem; font-weight: 700; }

.order-status {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.order-status.st-nuevo { background: #fff3d6; color: #9a6b00; }
.order-status.st-listo { background: #d9f2e3; color: #1b7a45; }
.order-status.st-entregado { background: #eae6f7; color: #6b5aa8; }

.order-items { list-style: none; margin: 6px 0; padding: 0; font-size: 0.9rem; color: var(--ink-soft); }
.order-items li { padding: 2px 0; }
.order-total { font-size: 0.95rem; }

/* ---------- Página de admin ---------- */
.admin-page { background: var(--paper); min-height: 100vh; }
.admin-main { padding: 30px 0 60px; }

.login-gate { display: flex; justify-content: center; padding: 40px 0; }
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}
.login-card h2 { font-size: 1.5rem; margin-bottom: 4px; }
.login-card .sub { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 20px; }
.admin-note {
  background: #fffdf5;
  border: 1.5px solid #f0c14b;
  color: #9a6b00;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.admin-tab {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.admin-tab:hover { border-color: var(--accent); }
.admin-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-badge {
  display: none;
  background: var(--sun);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 0.72rem;
  margin-left: 4px;
}
.admin-tab.active .tab-badge { background: #fff; color: var(--accent); }

.admin-panel {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* pedidos en el panel */
.admin-order { background: #fff; }
.order-meta { font-size: 0.85rem; color: var(--ink-soft); font-weight: 700; margin-bottom: 6px; }
.order-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.order-status-sel {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* reseñas en el panel */
.admin-review {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}
.admin-review.is-pending { border-color: #f0c14b; background: #fffdf5; }
.ar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ar-stars { color: var(--sun); letter-spacing: 2px; }
.ar-status { font-size: 0.76rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.ar-status.pend { background: #fff3d6; color: #9a6b00; }
.ar-status.ok { background: #d9f2e3; color: #1b7a45; }
.ar-text { font-size: 0.95rem; line-height: 1.45; margin-bottom: 8px; }
.ar-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ar-author { color: var(--ink-soft); font-size: 0.85rem; font-weight: 700; }
.ar-actions { display: flex; gap: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-scene { min-height: 0; margin-top: 8px; }
  .float-el { display: none; }
  .tag { left: auto; right: -8px; }
  .location { grid-template-columns: 1fr; }
  .location .map-wrap { order: 1; }
  .location .loc-info { order: 2; }

  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(253, 249, 240, 0.98);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    padding: 6px 0;
    display: none;
  }
  header.nav-open nav { display: flex; }
  header.nav-open .menu-toggle { border-color: var(--accent); color: var(--accent); }
  nav a { padding: 13px 6%; border-radius: 0; }
  nav a:hover { background: rgba(0, 0, 0, 0.04); }
}

/* ============================================================
   Micro-interacciones y accesibilidad (mejoras)
   ============================================================ */

/* Foco visible al navegar con teclado (accesibilidad) */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
}
:focus:not(:focus-visible) { outline: none; }

/* Aparición suave de las tarjetas de producto */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card { animation: cardIn 0.38s ease both; }

/* "Pop" del contador del carrito al agregar */
@keyframes cartBump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.cart-count.bump { animation: cartBump 0.35s ease; }

/* Realimentación al presionar botones */
.add-btn:active { transform: scale(0.94); }
.chip:active { transform: scale(0.96); }
.btn:active { transform: translateY(1px); }

/* Indicador de carga del catálogo */
.catalog-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 0;
  color: var(--ink-soft);
}
.catalog-loading .spinner {
  width: 38px;
  height: 38px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

/* Respetar la preferencia de movimiento reducido en las mejoras nuevas */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .cart-count.bump { animation: none; }
  .catalog-loading .spinner { animation-duration: 1.6s; }
  .add-btn:active, .chip:active, .btn:active { transform: none; }
}

/* Selector de orden del catálogo */
.sort-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
}
.sort-row select {
  font: 700 0.9rem "Nunito", sans-serif;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.sort-row select:hover, .sort-row select:focus { border-color: var(--accent); }

/* Vista de detalle de producto */
.card { cursor: pointer; }
.prod-detail { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.prod-detail-img {
  width: 100%;
  max-width: 260px;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: #faf6ee;
  border: 1px solid var(--line);
}
.prod-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-detail h3 { font-size: 1.4rem; }
.prod-detail .desc { color: var(--ink-soft); }
.prod-detail-foot { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
#productBody .close-btn { position: absolute; top: 14px; right: 14px; }

/* Suavizar el efecto holográfico de las tarjetas: sin parpadeo de colores
   y mucho más tenue (antes era demasiado). */
.card .content::after {
  animation: none;
  opacity: 0.05;
}
.card .content::before {
  opacity: 0.07;
}

/* ============================================================
   Borde cónico animado del modal de detalle de producto
   (colores de la marca, sutil pero llamativo)
   ============================================================ */
@property --pb-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

#productModal #productBody {
  border: 3px solid transparent;
  border-radius: 20px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(
      from var(--pb-angle, 0deg),
      var(--accent),
      var(--sun),
      #7b5cff,
      var(--accent),
      var(--accent-dark),
      var(--accent)
    ) border-box;
  box-shadow: 0 18px 50px rgba(43, 35, 80, 0.28);
}

#productModal.open #productBody {
  animation: prodBorderSpin 6s linear infinite, prodPop 0.4s ease both;
}

@keyframes prodBorderSpin {
  to { --pb-angle: 360deg; }
}

@keyframes prodPop {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #productModal.open #productBody { animation: none; }
}

/* ============================================================
   MÓVIL: menú de pantalla completa + catálogo en 2 columnas
   ============================================================ */
.nav-topbar { display: none; }
body.menu-locked { overflow: hidden; }

@media (max-width: 860px) {
  /* El menú hamburguesa abre una pantalla completa (no scrollea la página) */
  nav#mainNav {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 200;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin: 0;
    background: #fdf9f0;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10%);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }
  header.nav-open nav#mainNav { opacity: 1; visibility: visible; transform: translateX(0); }

  .nav-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
  }
  .nav-title { font: 800 1.35rem "Baloo 2", sans-serif; color: var(--ink); }
  .nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font: 800 0.95rem "Nunito", sans-serif;
    cursor: pointer;
  }
  nav#mainNav a {
    padding: 20px 24px;
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    background: none;
  }
  nav#mainNav a:hover, nav#mainNav a:active { background: rgba(0, 0, 0, 0.04); }
}

@media (max-width: 600px) {
  /* Dos columnas de productos + tarjetas compactas */
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card .content { padding: 11px; gap: 6px; }
  .card .thumb { height: 90px; font-size: 2.2rem; }
  .card .cat { font-size: 0.62rem; }
  .card h3 { font-size: 0.9rem; line-height: 1.2; }
  .card .desc { font-size: 0.75rem; }
  .card .foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .card .price { font-size: 1rem; }
  .add-btn { width: 100%; padding: 9px 8px; }
  .qty-ctrl { width: 100%; justify-content: center; }
  .sort-row { flex-wrap: wrap; }
  .low-badge { top: 14px; right: 14px; }
}

/* Header compacto en celular (que entren logo + botones + menú) */
@media (max-width: 600px) {
  .header-inner { gap: 8px; }
  .logo { font-size: 1.1rem; }
  .logo .badge { font-size: 1rem; }
  .login-btn { padding: 7px 11px; font-size: 0.82rem; }
  .cart-btn { padding: 8px 12px; font-size: 0.86rem; }
  .cart-btn .btn-label { display: none; }
  .menu-toggle { width: 40px; height: 40px; font-size: 1.2rem; }
}

/* ============================================================
   Vistas por apartado (celular): cada opción del menú abre su
   sección a pantalla completa, con botón Volver.
   ============================================================ */
.view-back { display: none; }

@media (max-width: 860px) {
  body.mobile-view > section,
  body.mobile-view > footer { display: none; }

  body.mobile-view.view-como-comprar #como-comprar,
  body.mobile-view.view-catalogo #catalogo,
  body.mobile-view.view-ubicacion #ubicacion {
    display: block;
    padding-top: 26px;
    animation: viewIn 0.28s ease both;
  }

  body.mobile-view .view-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    top: 70px;
    left: 14px;
    z-index: 60;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font: 800 0.9rem "Nunito", sans-serif;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    cursor: pointer;
  }
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.mobile-view.view-como-comprar #como-comprar,
  body.mobile-view.view-catalogo #catalogo,
  body.mobile-view.view-ubicacion #ubicacion { animation: none; }
}

/* ============================================================
   Vistas por apartado en TODAS las pantallas (también escritorio):
   tocar una opción del menú abre esa sección sola, con botón Volver.
   ============================================================ */
body.mobile-view > section,
body.mobile-view > footer { display: none; }

body.mobile-view.view-como-comprar #como-comprar,
body.mobile-view.view-catalogo #catalogo,
body.mobile-view.view-ubicacion #ubicacion {
  display: block;
  animation: viewIn 0.28s ease both;
}

body.mobile-view .view-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: fixed;
  top: 78px;
  left: 20px;
  z-index: 60;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font: 800 0.95rem "Nunito", sans-serif;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
body.mobile-view .view-back:hover { background: var(--accent-dark); }

/* Menú móvil: las opciones como botones grandes y claros (se ven mejor) */
@media (max-width: 860px) {
  nav#mainNav { padding-bottom: 30px; }
  nav#mainNav a {
    margin: 16px 22px 0;
    padding: 22px 24px;
    border: 2px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(43, 35, 80, 0.06);
    font-size: 1.25rem;
    text-align: center;
    transition: transform 0.12s ease, border-color 0.15s, color 0.15s;
  }
  nav#mainNav a:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
  nav#mainNav a:active { transform: scale(0.98); }
}

/* FIX: el backdrop-filter del header creaba un "contenedor" que impedía que
   el menú a pantalla completa (position:fixed, hijo del header) cubriera toda
   la pantalla. Lo quitamos en celular para que el menú ocupe todo. */
@media (max-width: 860px) {
  header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(253, 249, 240, 0.98);
  }
}

/* ============================================================
   Identidad propia de cada apartado: cabecera con color, ícono
   y mensaje distinto (solo cuando se ve como apartado).
   ============================================================ */
.apartado-hero { display: none; }

body.mobile-view .apartado-hero {
  display: block;
  text-align: center;
  padding: 44px 24px 32px;
  margin-bottom: 28px;
  border-radius: 0 0 32px 32px;
  box-shadow: 0 10px 26px rgba(43, 35, 80, 0.12);
  animation: viewIn 0.3s ease both;
}
body.mobile-view .apartado-hero .ah-emoji { font-size: 3.4rem; display: block; line-height: 1; margin-bottom: 10px; }
body.mobile-view .apartado-hero h2 { font-size: clamp(1.9rem, 6vw, 2.6rem); line-height: 1.05; margin: 0; }
body.mobile-view .apartado-hero p { font-weight: 700; margin: 8px auto 0; max-width: 32ch; font-size: 1.05rem; }

.ah-comprar { background: linear-gradient(135deg, #2f6fe0, #7db0ff); }
.ah-comprar h2, .ah-comprar p { color: #fff; }
.ah-catalogo { background: linear-gradient(135deg, #ff2288, #ff7ab0); }
.ah-catalogo h2, .ah-catalogo p { color: #fff; }
.ah-ubicacion { background: linear-gradient(135deg, #ffbe2e, #ffe08a); }
.ah-ubicacion h2, .ah-ubicacion p { color: var(--ink); }

/* En modo apartado ocultamos el encabezado genérico (no duplicar el título) */
body.mobile-view .section-head { display: none; }

/* Botón Volver en blanco para que resalte sobre cualquier cabecera de color */
body.mobile-view .view-back { background: #fff; color: var(--ink); }
body.mobile-view .view-back:hover { background: #fff; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  body.mobile-view .apartado-hero { animation: none; }
}

/* Evita el desborde horizontal del cajón del carrito (que en iPhone dejaba
   un espacio en blanco al final de la página). */
html, body { overflow-x: clip; }

/* Fotos de producto: siempre llenan el recuadro y quedan centradas */
.card .thumb, .thumb-sm, .admin-thumb, .prod-detail-img { position: relative; }
.card .thumb > img,
.thumb-sm > img,
.admin-thumb > img,
.prod-detail-img > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
}

/* Ojito para ver/ocultar la contraseña */
.pass-field { position: relative; display: block; }
.pass-field > input { width: 100%; padding-right: 46px; }
.pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 6px;
  opacity: 0.65;
}
.pass-toggle:hover { opacity: 1; }

/* ============================================================
   Cartas y fotos más grandes; imagen siempre centrada y visible
   ============================================================ */
.grid { grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 22px; }
.card .thumb { height: 180px; }

/* Vista de detalle: imagen grande, centrada y con recorte parejo */
.prod-detail-img { width: 100%; max-width: 320px; height: 240px; margin: 0 auto; }

@media (max-width: 600px) {
  /* En celular: 2 columnas pero con la foto bien visible */
  .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .card .thumb { height: 148px; }
  .card .content { padding: 12px; gap: 6px; }
  .card h3 { font-size: 0.95rem; }
  .card .desc { font-size: 0.78rem; }
  .prod-detail-img { height: 220px; max-width: 100%; }
}

/* Imagen del detalle más grande + zoom a pantalla completa al tocarla */
.prod-detail-img { max-width: 100%; height: 280px; }
.prod-detail-img img { cursor: zoom-in; }
@media (max-width: 600px) { .prod-detail-img { height: 240px; } }

.img-zoom {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px;
}
.img-zoom.open { display: flex; }
.img-zoom img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  cursor: zoom-in;
  margin: auto;
}
.img-zoom.zoomed { align-items: flex-start; justify-content: flex-start; }
.img-zoom.zoomed img {
  max-width: none;
  max-height: none;
  width: 165%;
  height: auto;
  cursor: zoom-out;
}
.img-zoom-close {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 310;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #2b2350;
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.img-zoom-close:hover { background: #fff; }

/* ============================================================
   PULIDO RESPONSIVE FINAL — PC · tablet · celular
   ============================================================ */
/* Catálogo */
.grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.card .thumb { height: 190px; }
.card .foot { margin-top: auto; }           /* precio+botón siempre al pie */
.prod-detail-img { height: 300px; }

/* Tablet */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 18px; }
  .card .thumb { height: 172px; }
}

/* Celular: 2 columnas prolijas */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card .thumb { height: 140px; }
  .card .content { padding: 12px; gap: 6px; }
  .card .cat { font-size: 0.62rem; }
  .card h3 { font-size: 0.92rem; line-height: 1.2; }
  .card .desc { font-size: 0.76rem; }
  .card .price { font-size: 1.02rem; }
  .card .foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .add-btn { width: 100%; padding: 10px 8px; }
  .qty-ctrl { width: 100%; justify-content: center; }
  .sort-row { flex-wrap: wrap; row-gap: 8px; }
  .section-head h2 { font-size: 1.6rem; }
  .prod-detail-img { height: 230px; }
  .prod-detail-foot { flex-direction: column; gap: 12px; }
  .prod-detail-foot .btn { width: 100%; justify-content: center; }
}

/* Celular muy chico: 1 columna grande */
@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
  .card .thumb { height: 200px; }
  .card .foot { flex-direction: row; align-items: center; }
  .add-btn { width: auto; }
}

/* Botón cerrar del detalle: círculo blanco visible sobre la foto */
#productBody .close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
#productBody .close-btn:hover { background: #fff; color: var(--accent); }
