:root {
  color-scheme: light only;
  --font-round: "Baloo 2", "Space Grotesk", sans-serif;
  --bg: #fff9e9;
  --bg-soft: #fffdf5;
  --ink: #121117;
  --ink-soft: #565062;
  --line: rgba(18, 17, 23, 0.14);
  --brand: #f8c813;
  --brand-2: #31c9d2;
  --brand-3: #ef7582;
  --brand-4: #f47a11;
  --shadow: 0 16px 34px rgba(45, 34, 14, 0.12);
  --text-strong: #1f1912;
  --text-soft-strong: #34281f;
  --surface-glass: rgba(255, 255, 255, 0.18);
  --surface-glass-soft: rgba(255, 255, 255, 0.08);
  --overlay-dark: rgba(7, 7, 10, 0.88);
  --overlay-soft: rgba(7, 7, 10, 0.35);
  --on-dark: #fff8ea;
  --warning: #f47a11;
  --warning-soft: rgba(244, 122, 17, 0.14);
  --warning-line: rgba(244, 122, 17, 0.28);
  --success: #25d366;
  --success-soft: rgba(37, 211, 102, 0.2);
  --social-instagram: #bc2a8d;
  --social-instagram-soft: rgba(188, 42, 141, 0.2);
  --social-info: #2d7df6;
  --danger: #ef7582;
  --danger-soft: rgba(239, 117, 130, 0.14);
  --danger-line: rgba(239, 117, 130, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 20%, rgba(248, 200, 19, 0.28), transparent 35%),
    radial-gradient(circle at 88% 16%, rgba(49, 201, 210, 0.2), transparent 28%),
    linear-gradient(145deg, #fff9e9 0%, #fff4dd 100%);
}

body.connected {
  --bg: #1a1410;
  --bg-soft: rgba(30, 23, 18, 0.84);
  --ink: #fff5d5;
  --ink-soft: #f4dca0;
  --line: rgba(255, 230, 171, 0.2);
  --brand: #f8c813;
  --brand-2: #31c9d2;
  --brand-3: #ef7582;
  --brand-4: #f47a11;
  --shadow: 0 24px 44px rgba(0, 0, 0, 0.35);
  --text-strong: #fff1d1;
  --text-soft-strong: #ffe2b4;
  --surface-glass: rgba(255, 255, 255, 0.16);
  --surface-glass-soft: rgba(255, 255, 255, 0.08);
  --overlay-dark: rgba(7, 7, 10, 0.9);
  --overlay-soft: rgba(7, 7, 10, 0.35);
  --on-dark: #fff8ea;
  --warning-soft: rgba(244, 122, 17, 0.22);
  --warning-line: rgba(244, 122, 17, 0.38);
  --success-soft: rgba(37, 211, 102, 0.26);
  --social-instagram-soft: rgba(188, 42, 141, 0.28);
  --danger-soft: rgba(239, 117, 130, 0.2);
  --danger-line: rgba(255, 198, 206, 0.42);
  background:
    radial-gradient(circle at 12% 20%, rgba(248, 200, 19, 0.32), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(49, 201, 210, 0.23), transparent 30%),
    radial-gradient(circle at 76% 80%, rgba(239, 117, 130, 0.22), transparent 32%),
    linear-gradient(152deg, #1a1410 0%, #2b1c14 100%);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(12, 9, 7, 0.88);
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
  color: #fff7df;
}

.loading-overlay.hidden {
  display: none;
}

.loading-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(248, 200, 19, 0.9);
  box-shadow: 0 0 0 10px rgba(49, 201, 210, 0.15);
  animation: spin 1.15s linear infinite;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  filter: blur(68px);
  opacity: 0.26;
  transition: opacity 350ms ease;
}

body.connected .bg-shape {
  opacity: 0.58;
}

.shape-1 {
  width: 270px;
  height: 270px;
  top: -40px;
  left: -70px;
  border-radius: 50%;
  background: rgba(248, 200, 19, 0.52);
}

.shape-2 {
  width: 320px;
  height: 320px;
  right: -90px;
  bottom: -70px;
  border-radius: 41% 59% 52% 48% / 55% 45% 55% 45%;
  background: rgba(49, 201, 210, 0.35);
}

.topbar {
  width: min(1200px, 94vw);
  margin: 0 auto;
  padding: 16px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.title-wrap h1 {
  grid-column: 2;
  align-self: center;
  margin: 0;
  font-family: var(--font-round);
  font-weight: 700;
  font-size: clamp(1.45rem, 2.9vw, 2.45rem);
  letter-spacing: 0.03em;
  text-align: center;
}

.title-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "logo title"
    "subtitle subtitle";
  column-gap: 10px;
  row-gap: 4px;
  column-gap: 24px;
  row-gap: 6px;
  max-width: 760px;
}

.brand-logo {
  grid-area: logo;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 6px;
  border: 3px solid rgba(248, 200, 19, 0.9);
  box-shadow: 0 10px 22px rgba(244, 122, 17, 0.28);
  transition: box-shadow 220ms ease, border-color 220ms ease;
}

body.connected .brand-logo {
  border-color: rgba(49, 201, 210, 0.9);
  box-shadow: 0 12px 28px rgba(49, 201, 210, 0.22);
}

body.shop-open .brand-logo {
  border-color: rgba(47, 224, 125, 0.9);
  box-shadow:
    0 0 0 8px rgba(47, 224, 125, 0.16),
    0 10px 26px rgba(47, 224, 125, 0.34);
  animation: haloPulseOpen 1.8s ease-in-out infinite;
}

body.shop-closed .brand-logo {
  border-color: rgba(255, 141, 82, 0.9);
  box-shadow:
    0 0 0 8px rgba(255, 141, 82, 0.14),
    0 10px 26px rgba(255, 141, 82, 0.28);
  animation: haloPulseClosed 1.9s ease-in-out infinite;
}

.title-wrap p {
  grid-area: subtitle;
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
}

/* ── PEDIDOS Y ENVIOS ─────────────────── */
.info-tab-hero {
  margin-top: 14px;
}

.info-tab-hero h2 {
  margin: 0 0 10px;
  font-family: var(--font-round);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  line-height: 1.1;
}

.orders-layout {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.order-lead {
  margin: 0;
  max-width: 72ch;
  color: var(--ink-soft);
  line-height: 1.7;
}

.order-card {
  display: grid;
  gap: 12px;
}

.order-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.order-icon {
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(248, 200, 19, 0.24), rgba(244, 122, 17, 0.18));
  border: 1px solid rgba(248, 200, 19, 0.42);
  color: var(--text-strong);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  line-height: 0;
}

.order-icon svg {
  width: 12px;
  min-width: 12px;
  max-width: 12px;
  height: 12px;
  min-height: 12px;
  max-height: 12px;
  display: block;
  flex: 0 0 12px;
}

.order-kicker {
  margin: 4px 0 0;
  color: var(--text-soft-strong);
  font-size: 0.9rem;
  line-height: 1.45;
}

.order-card h3,
.order-card h4 {
  margin: 0;
  font-family: var(--font-round);
  color: var(--ink);
}

.order-card h3 {
  font-size: 1.2rem;
  line-height: 1.15;
}

.order-card h4 {
  font-size: 1rem;
  color: var(--text-soft-strong);
  padding-top: 2px;
}

.order-card p,
.order-card li {
  color: var(--ink-soft);
  line-height: 1.7;
}

.order-card p {
  margin: 0;
}

.order-card p:last-child {
  margin-bottom: 0;
}

.order-intro {
  font-weight: 500;
  color: var(--text-soft-strong);
}

.order-note {
  border-left: 3px solid rgba(248, 200, 19, 0.65);
  padding-left: 12px;
  color: var(--text-soft-strong);
  font-weight: 600;
  background: rgba(248, 200, 19, 0.08);
  border-radius: 0 12px 12px 0;
  padding-top: 10px;
  padding-bottom: 10px;
}

.order-highlight {
  font-weight: 700;
}

.order-highlight-whatsapp {
  color: #1f9d57;
}

.order-highlight-instagram {
  color: #d14d72;
}

.order-highlight-bizum {
  color: #c2187a;
}

.order-highlight-transfer {
  color: var(--social-info);
}

.order-highlight-correos {
  color: color-mix(in srgb, var(--social-info) 88%, #102c55);
}

.order-highlight-mail {
  color: var(--social-info);
}

.order-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--warning-line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(244, 122, 17, 0.08), rgba(248, 200, 19, 0.06));
  color: var(--text-soft-strong);
}

.order-alert-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-family: var(--font-round);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.order-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.actions {
  display: flex;
  gap: 10px;
}

.container {
  width: min(1200px, 94vw);
  margin: 0 auto 32px;
}

/* ── WHATSAPP FAB ─────────────────────── */
.whatsapp-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--success);
  color: var(--on-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45), 0 2px 8px rgba(0,0,0,0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, width 220ms ease, padding 220ms ease, gap 220ms ease;
}

.whatsapp-fab svg {
  flex-shrink: 0;
}

.whatsapp-fab span {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  transform: translateX(6px);
  transition: max-width 220ms ease, opacity 180ms ease, transform 220ms ease, margin-left 220ms ease;
}

.whatsapp-fab:focus-visible {
  width: 170px;
  gap: 8px;
  padding: 0 14px;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 32px rgba(37, 211, 102, 0.55), 0 4px 12px rgba(0,0,0,0.2);
}

.whatsapp-fab:focus-visible span {
  max-width: 120px;
  opacity: 1;
  transform: translateX(0);
}

@media (hover: hover) {
  .whatsapp-fab:hover {
    width: 170px;
    gap: 8px;
    padding: 0 14px;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 32px rgba(37, 211, 102, 0.55), 0 4px 12px rgba(0,0,0,0.2);
  }

  .whatsapp-fab:hover span {
    max-width: 120px;
    opacity: 1;
    transform: translateX(0);
  }
}

.whatsapp-fab:active {
  transform: translateY(0) scale(0.98);
}

.hidden {
  display: none !important;
}

/* ── TABS ─────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.deep-link-notice {
  margin: -8px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.35;
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: color-mix(in srgb, var(--danger) 64%, #341920);
}

body.connected .deep-link-notice {
  color: color-mix(in srgb, var(--danger) 24%, white);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-soft-strong);
  font-family: var(--font-round);
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 18px;
  cursor: pointer;
  margin-bottom: -1px;
  border-radius: 10px 10px 0 0;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tab-btn:hover {
  color: var(--text-strong);
  background: rgba(248, 200, 19, 0.16);
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: rgba(248, 200, 19, 0.1);
}

body.connected .tab-btn {
  color: color-mix(in srgb, var(--brand) 24%, white);
}

body.connected .tab-btn:hover {
  color: var(--on-dark);
  background: rgba(248, 200, 19, 0.18);
}

/* ── HISTORIA ─────────────────────────── */
.historia-hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  height: 380px;
  margin-bottom: 40px;
}

.historia-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.historia-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7,7,10,0.82) 0%, rgba(7,7,10,0.28) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px 40px;
  color: var(--on-dark);
}

.historia-hero-overlay .eyebrow {
  color: var(--brand);
  margin-bottom: 6px;
}

.historia-hero-overlay h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 10px;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.historia-hero-overlay p {
  font-size: 1rem;
  opacity: 0.82;
  margin: 0;
  max-width: 520px;
}

.historia-body {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 48px;
  align-items: start;
  padding-bottom: 40px;
}

.historia-info {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
}

.contact-card,
.location-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(160deg, var(--surface-glass), color-mix(in srgb, var(--surface-glass-soft) 88%, transparent));
  box-shadow: var(--shadow);
}

.hours-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface-glass) 108%, transparent), var(--surface-glass-soft));
  box-shadow: var(--shadow);
}

.hours-title {
  margin: 0 0 9px;
  font-family: var(--font-round);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-strong);
  font-weight: 700;
}

.historia-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.historia-pills span {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-soft-strong);
  border: 1px solid rgba(248, 200, 19, 0.4);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(248, 200, 19, 0.16);
}

.historia-address {
  font-size: 0.88rem;
  color: var(--text-soft-strong);
  margin: 0;
  line-height: 1.5;
}

.historia-block-title {
  margin: 2px 0 8px;
  font-family: var(--font-round);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft-strong);
  font-weight: 700;
}

.shop-open-status {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--text-strong);
  font-weight: 700;
}

.shop-open-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #8a8a8a;
  box-shadow: 0 0 0 5px rgba(138, 138, 138, 0.2);
}

.shop-open-status.open::before {
  background: #2fe07d;
  box-shadow: 0 0 0 5px rgba(47, 224, 125, 0.22);
}

.shop-open-status.closed::before {
  background: #ff8d52;
  box-shadow: 0 0 0 5px rgba(255, 141, 82, 0.2);
}

.shop-open-detail {
  display: none;
}

body.connected .historia-pills span {
  color: #ffeec5;
  background: rgba(248, 200, 19, 0.2);
}

body.connected .hours-title {
  color: #fff0d4;
}

body.connected .shop-open-status {
  color: #fff6ea;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

body.connected .historia-address {
  color: #ffe3cb;
}

body.connected .historia-block-title {
  color: #ffe6c9;
}

.historia-map {
  margin-top: 8px;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  justify-self: stretch;
}

.historia-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.historia-text {
  border-left: 2px solid var(--line);
  padding-left: 36px;
}

.historia-text .eyebrow {
  margin-bottom: 6px;
}

.historia-text h3 {
  font-family: var(--font-round);
  font-size: 1.5rem;
  margin: 0 0 20px;
}

.historia-text p {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--ink-soft);
  margin: 0 0 20px;
}

.historia-text p:last-child {
  margin-bottom: 0;
}

/* ── BRAND HERO ───────────────────────── */
.brand-hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-lite {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--brand-4);
}

.brand-bio h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  line-height: 1.2;
}

.brand-bio p {
  color: var(--ink-soft);
}

.info-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.info-pills span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.25);
}

.brand-links h3 {
  margin: 0;
}

.brand-links p {
  margin: 8px 0 10px;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.historia-info .quick-links {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.historia-info .quick-link:first-child {
  color: color-mix(in srgb, var(--success) 45%, #114d2f);
  border-color: rgba(37, 211, 102, 0.45);
  background: linear-gradient(120deg, rgba(37, 211, 102, 0.25), rgba(37, 211, 102, 0.1));
}

.historia-info .quick-link:last-child {
  color: color-mix(in srgb, var(--social-instagram) 72%, #22102f);
  border-color: rgba(188, 42, 141, 0.45);
  background: linear-gradient(120deg, rgba(188, 42, 141, 0.22), rgba(251, 173, 80, 0.13));
}

.historia-info .quick-link svg {
  width: 16px;
  height: 16px;
}

@media (hover: hover) {
  .quick-link:hover {
    transform: translateY(-2px);
    color: var(--ink);
    border-color: rgba(248, 200, 19, 0.7);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  }
}

body.connected .historia-info .quick-links {
  background: transparent;
}

body.connected .historia-info .quick-link:first-child {
  color: #c6ffd9;
}

body.connected .historia-info .quick-link:last-child {
  color: #ffd4ee;
}

.panel,
.catalog-shell {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.panel {
  padding: 18px;
}

.panel p,
.panel li {
  color: var(--ink-soft);
}

.catalog-shell {
  margin-top: 14px;
  padding: 16px;
  display: block;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.catalog-title {
  margin: 0;
  font-size: 1.1rem;
}

.status {
  font-weight: 500;
  color: var(--ink-soft);
}

/* ── BUSCADOR ─────────────────────────── */
.filters-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  -webkit-appearance: none;
}

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

.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(248, 200, 19, 0.18);
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  padding: 4px;
  border-radius: 50%;
  transition: color 120ms ease, background 120ms ease;
}

.search-clear:hover {
  color: var(--ink);
  background: var(--line);
}

.sort-wrap {
  display: grid;
  gap: 3px;
}

.sort-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.sort-select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  padding: 9px 11px;
  cursor: pointer;
  min-width: 225px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(248, 200, 19, 0.18);
}

.category-section {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
}

.menu-label {
  margin: 0 0 8px;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}

.menu-label.sub {
  margin-top: 10px;
}

.category-menu {
  margin-top: 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 1px 6px;
}

.subcategory-menu {
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  padding-top: 12px;
}

.category-menu::-webkit-scrollbar {
  height: 8px;
}

.category-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.category-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

@media (hover: hover) {
  .category-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.35);
  }
}

.category-chip.active {
  border-color: #f1b43a;
  color: var(--text-strong);
  background-color: var(--brand);
  background-image: linear-gradient(120deg, var(--brand), var(--brand-4));
  background-clip: padding-box;
  box-shadow: 0 8px 20px rgba(244, 122, 17, 0.26);
}

.image-price-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.image-price-tag.strikethrough {
  color: var(--text-strong);
  background-color: rgba(255, 239, 170, 0.55);
  background-image: linear-gradient(
    to bottom right,
    transparent calc(50% - 0.85px),
    #ef7582 calc(50% - 0.85px),
    #ef7582 calc(50% + 0.85px),
    transparent calc(50% + 0.85px)
  );
  border-color: rgba(180, 180, 180, 0.3);
  box-shadow: none;
  font-size: 0.66rem;
}

.image-price-tag.sale-price {
  color: #ef7582;
  font-weight: 700;
  font-size: 0.95rem;
}

.category-chip.offer-chip:not(.active) {
  background: var(--bg-soft);
  color: #d75266;
  border-color: rgba(239, 117, 130, 0.5);
  box-shadow: 0 4px 12px rgba(239, 117, 130, 0.12);
}

.category-chip.anniversary-chip:not(.active) {
  background: var(--bg-soft);
  color: #0f8b96;
  border-color: rgba(49, 201, 210, 0.55);
  box-shadow: 0 4px 12px rgba(49, 201, 210, 0.12);
}

.category-chip.pinned-chip:not(.active) {
  background: linear-gradient(145deg, rgba(248, 200, 19, 0.24), rgba(244, 122, 17, 0.2));
  color: var(--text-strong);
  border-color: rgba(248, 200, 19, 0.78);
  box-shadow: 0 5px 14px rgba(244, 122, 17, 0.18);
}

.category-chip.soft-active {
  border-color: rgba(248, 200, 19, 0.8);
  color: var(--text-strong);
  background: #fff4cc;
  box-shadow: 0 0 0 2px rgba(248, 200, 19, 0.2);
}

body.connected .category-chip.soft-active {
  border-color: rgba(248, 200, 19, 0.95);
  color: #fff7e5;
  background: rgba(248, 200, 19, 0.22);
  box-shadow: 0 0 0 2px rgba(248, 200, 19, 0.3);
}

.gallery-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

body.lightbox-open {
  overflow: hidden;
}

.image-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 240px;
  aspect-ratio: 4 / 5;
  background: #2a211a;
  contain: paint;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  animation: rise 420ms ease forwards;
}

.image-card.offer-item {
  border-color: rgba(248, 200, 19, 0.8);
  box-shadow: 0 0 0 1px rgba(248, 200, 19, 0.6), 0 18px 30px rgba(244, 122, 17, 0.28);
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.anniversary-stamp {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  border: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.32),
    0 0 12px rgba(255, 176, 75, 0.84),
    0 0 28px rgba(255, 120, 20, 0.62),
    0 14px 18px rgba(255, 128, 18, 0.44),
    0 26px 38px rgba(255, 86, 5, 0.32),
    0 8px 20px rgba(0, 0, 0, 0.36);
  background: radial-gradient(circle at 35% 25%, #ffe9bf 0%, #f5a640 52%, #8e4413 100%);
}

.anniversary-stamp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-card.out-of-stock img {
  filter: blur(2.4px) brightness(0.72) saturate(0.85);
  transform: scale(1.02);
}

.stock-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(10, 10, 12, 0.7);
  color: var(--on-dark);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
}

.image-caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(7, 7, 10, 0.35) 0%, rgba(7, 7, 10, 0.88) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  color: var(--on-dark);
  display: flex;
  gap: 10px;
  align-items: center;
}

.image-caption h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.image-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.image-tag {
  width: fit-content;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: color-mix(in srgb, var(--brand) 30%, white);
  border: 1px solid rgba(248, 200, 19, 0.46);
  border-radius: 999px;
  padding: 3px 8px;
}

.offer-badge {
  width: fit-content;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--text-strong);
  border-radius: 999px;
  padding: 3px 8px;
  background: linear-gradient(120deg, #f8c813, #f47a11);
}

.image-price-tag {
  margin-left: auto;
  align-self: center;
  flex-shrink: 0;
  color: var(--text-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 5px 10px;
  background: linear-gradient(120deg, #ffffff, #ffe9ad);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(6, 6, 10, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lightbox-image {
  max-width: min(94vw, 1100px);
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48);
}

.lightbox-caption {
  margin: 12px 0 0;
  color: var(--on-dark);
  font-weight: 600;
  text-align: center;
}

.lightbox-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.lightbox-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  color: var(--on-dark);
  background: var(--success);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.lightbox-whatsapp:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 211, 102, 0.42);
}

.lightbox-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: var(--on-dark);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.lightbox-share:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.75);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(0, 0, 0, 0.38);
  color: var(--on-dark);
  font-size: 1.18rem;
  line-height: 1;
  cursor: pointer;
}


.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font: inherit;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease;
}

body.connected .btn {
  color: var(--on-dark);
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-1px);
  }
}

.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.btn.primary {
  border: 0;
  color: #15110b;
  background: linear-gradient(120deg, var(--brand), var(--brand-4));
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 16px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.05);
}

.error {
  color: #f17777;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes haloPulseOpen {
  0%,
  100% {
    box-shadow:
      0 0 0 7px rgba(47, 224, 125, 0.14),
      0 10px 24px rgba(47, 224, 125, 0.32);
  }
  50% {
    box-shadow:
      0 0 0 12px rgba(47, 224, 125, 0.24),
      0 12px 28px rgba(47, 224, 125, 0.44);
  }
}

@keyframes haloPulseClosed {
  0%,
  100% {
    box-shadow:
      0 0 0 7px rgba(255, 141, 82, 0.12),
      0 10px 24px rgba(255, 141, 82, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 12px rgba(255, 141, 82, 0.2),
      0 12px 28px rgba(255, 141, 82, 0.36);
  }
}

@media (max-width: 700px) {
  .brand-hero {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding-top: 12px;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
  }

  .title-wrap h1 {
    font-size: 1.28rem;
  }

  .title-wrap p {
    display: none;
  }

  .historia-map {
    width: 100%;
    max-width: none;
  }

  .historia-hero {
    height: 260px;
  }

  .historia-hero-overlay {
    padding: 24px 20px;
  }

  .historia-body {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .historia-info {
    position: static;
  }

  .historia-text {
    border-left: none;
    padding-left: 0;
    border-top: 2px solid var(--line);
    padding-top: 28px;
  }

  .filters-row {
    grid-template-columns: 1fr;
  }

  .sort-select {
    min-width: 0;
    width: 100%;
  }

  .category-section {
    padding: 10px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .image-card {
    min-height: 180px;
  }

  .anniversary-stamp {
    width: 48px;
    height: 48px;
    top: 7px;
    right: 7px;
  }

  .image-caption {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 8px 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .image-caption h3 {
    width: 100%;
    font-size: 0.84rem;
  }

  .image-price-wrap {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .image-tag,
  .offer-badge {
    font-size: 0.66rem;
  }

  .image-price-tag {
    margin-left: 0;
    font-size: 0.58rem;
    padding: 3px 6px;
    white-space: nowrap;
    line-height: 1;
  }

  .image-price-tag.sale-price {
    font-size: 0.76rem;
  }

  .image-price-tag.strikethrough {
    font-size: 0.53rem;
  }

  .orders-layout {
    gap: 12px;
  }

  .order-card-head {
    gap: 8px;
  }

  .order-icon {
    flex-basis: 24px;
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    border-radius: 8px;
  }

  .order-icon svg {
    width: 10px;
    min-width: 10px;
    max-width: 10px;
    height: 10px;
    min-height: 10px;
    max-height: 10px;
    flex-basis: 10px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .panel,
  .panel-lite,
  .catalog-shell,
  .image-caption,
  .stock-overlay {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .image-card {
    opacity: 1;
    transform: none;
    animation: none;
  }

  /* Formas de fondo sin filter: blur, que en Android se repinta al hacer scroll */
  .bg-shape {
    filter: none;
  }

  .shape-1 {
    background: radial-gradient(circle, rgba(248, 200, 19, 0.42) 0%, transparent 70%);
  }

  .shape-2 {
    background: radial-gradient(circle, rgba(49, 201, 210, 0.3) 0%, transparent 70%);
  }

  /* El halo del logo se queda fijo: animar box-shadow repinta en cada frame */
  body.shop-open .brand-logo,
  body.shop-closed .brand-logo {
    animation: none;
  }

  .category-chip,
  .image-card img {
    -webkit-tap-highlight-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.shop-open .brand-logo,
  body.shop-closed .brand-logo,
  .image-card {
    animation: none;
  }

  .image-card {
    opacity: 1;
    transform: none;
  }
}
