@font-face { font-family: "Witchy Whiskers"; src: url("../fonts/WitchyWhiskers.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
:root {
  --bg: #1d1d1f;
  --bg-2: #262628;
  --fg: #f4f1ec;
  --muted: #a7a39c;
  --line: #3a3a3d;
  --accent: #c9b8ff;
  --danger: #ff7a7a;
  --radius: 14px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-logo: "Witchy Whiskers", "Impact", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.6; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 500; }
p { margin: 0 0 1em; }
ul { list-style: none; margin: 0; padding: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.right { text-align: right; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Barra de anuncio */
.announcement { text-align: center; padding: 14px var(--gutter); font-weight: 500; border-bottom: 1px solid var(--line); font-size: .95rem; }

/* Cabecera */
.site-header {
  display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center;
  gap: clamp(16px, 3vw, 48px); padding: 28px var(--gutter); max-width: 1500px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 18px; color: var(--fg); }
.logo-moon { width: 84px; height: auto; flex: none; }
.brand-name { font-family: var(--font-logo); font-size: clamp(1.4rem, 2.4vw, 2.1rem); letter-spacing: .02em; line-height: 1; }
.search { display: flex; background: #fff; border-radius: 999px; padding: 5px; max-width: 720px; width: 100%; justify-self: center; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 18px; font: inherit; color: #222; outline: 0; }
.search button { border: 0; background: #ececec; color: #222; border-radius: 999px; width: 56px; cursor: pointer; display: grid; place-items: center; }
.search button:hover { background: #ddd; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; gap: 12px; font-size: .9rem; }
.lang-switch a { color: var(--muted); }
.lang-switch a.active { color: var(--fg); font-weight: 600; }
.icon-btn { position: relative; background: none; border: 0; color: var(--fg); cursor: pointer; padding: 6px; display: grid; place-items: center; }
.icon-btn:hover { color: var(--accent); }
.badge { position: absolute; top: -4px; right: -6px; background: #fff; color: #111; font-size: .7rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; padding: 0 5px; }

/* Menú lateral */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 86vw); background: var(--bg-2); z-index: 50; padding: 28px; transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.drawer-close { position: absolute; top: 14px; right: 14px; font-size: 1.2rem; }
.drawer h3 { margin-top: 28px; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.drawer li a { display: block; padding: 8px 0; font-size: 1.1rem; }

/* Hero con categorías */
.hero { display: grid; grid-template-columns: repeat(3, 1fr); min-height: clamp(280px, 38vw, 430px); }
.hero-1 { grid-template-columns: 1fr; } .hero-2 { grid-template-columns: repeat(2, 1fr); } .hero-4 { grid-template-columns: repeat(4, 1fr); }
.hero-tile { position: relative; overflow: hidden; display: grid; align-items: end; justify-items: center; background: #3a3a40; isolation: isolate; }
.hero-tile[data-tone="1"] { background: #5b2332; } .hero-tile[data-tone="2"] { background: #26365e; } .hero-tile[data-tone="3"] { background: #284a3e; }
.hero-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .6s ease; }
.hero-tile:hover img { transform: scale(1.04); }
.hero-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 55%); z-index: -1; }
.hero-label { display: grid; gap: 16px; text-align: center; padding: 0 16px 56px; color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.hero-title { font-size: clamp(1.4rem, 2.3vw, 2rem); font-weight: 500; }
.hero-cta { font-weight: 500; font-size: .95rem; border-bottom: 1px solid currentColor; justify-self: center; padding-bottom: 2px; }

/* Secciones */
.section { max-width: 1500px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--gutter); }
.section-title { text-align: center; font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 1.2em; }
.narrow { max-width: 780px; } .narrow-wide { max-width: 980px; }
.about-teaser { border-top: 1px solid var(--line); text-align: center; }
.about-teaser .narrow { margin: 0 auto; }

/* Rejilla de productos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: clamp(14px, 2vw, 28px); }
.card { display: block; color: inherit; }
.card-media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; display: grid; place-items: center; border-radius: 4px; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-media > .logo-moon { width: 40%; color: rgba(0,0,0,.35); }
.tag { position: absolute; top: 12px; right: 12px; background: var(--bg); color: var(--fg); border: 1px solid var(--fg); padding: 2px 10px; border-radius: 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.tag-sold { background: #fff; color: #111; }
.tag-inline { position: static; display: inline-block; vertical-align: middle; margin-left: 8px; }
.card-body { padding: 14px 2px 0; }
.card-body h3 { font-size: 1rem; margin: 0 0 2px; }
.price { margin: 0; color: var(--muted); } .price strong { color: var(--fg); font-weight: 500; } .price s { margin-right: 6px; }
.price.big { font-size: 1.5rem; }

/* Botones y formularios */
.btn { display: inline-block; background: var(--fg); color: #111; border: 1px solid var(--fg); border-radius: 999px; padding: 12px 28px; font: inherit; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #111; }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { color: #111; }
.btn-block { display: block; width: 100%; text-align: center; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; text-align: left; }
input[type=number], select { background: var(--bg-2); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; }
.toolbar { display: flex; justify-content: flex-end; margin: -10px 0 22px; color: var(--muted); }
.toolbar select { margin-left: 8px; }
.flash { max-width: 1500px; margin: 0 auto 0; padding: 12px var(--gutter); background: #24382c; border-bottom: 1px solid #3c6a4d; text-align: center; }
.flash-error { background: #422525; border-color: #7a3a3a; }

/* Producto */
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.gallery-main { aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden; border-radius: 4px; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main > .logo-moon { width: 30%; color: #555; }
.thumbs { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; }
.thumb { flex: none; width: 76px; aspect-ratio: 1; padding: 0; border: 2px solid transparent; background: none; cursor: pointer; border-radius: 4px; overflow: hidden; opacity: .65; }
.thumb.active, .thumb:hover { opacity: 1; border-color: var(--fg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.crumb { color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .1em; }
.buy { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-top: 18px; }
.buy label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.buy input { width: 90px; }

/* Texto de páginas */
.prose { color: #e4e0d9; } .prose h2 { margin-top: 1.6em; font-size: 1.35rem; } .prose a { text-decoration: underline; }
.section.page { max-width: 1100px; }
.page h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 1em; text-align: center; }

/* Carrito */
.cart-list { border-top: 1px solid var(--line); }
.cart-row { display: grid; grid-template-columns: 84px 1fr 80px 100px; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-thumb { aspect-ratio: 1; background: var(--bg-2); border-radius: 6px; overflow: hidden; display: grid; place-items: center; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .logo-moon { width: 60%; color: #666; }
.cart-info { display: grid; gap: 2px; justify-items: start; }
.qty { width: 100%; }
.cart-total { text-align: right; font-weight: 500; }
.summary { margin: 28px 0 0 auto; max-width: 400px; display: grid; gap: 10px; }
.summary > div { display: flex; justify-content: space-between; }
.summary-total { font-size: 1.25rem; font-weight: 600; border-top: 1px solid var(--line); padding-top: 12px; }

/* Pie */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-grid { max-width: 1500px; margin: 0 auto; padding: 48px var(--gutter); display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; }
.footer-brand { font-family: var(--font-logo); font-size: 1.5rem; margin-bottom: 8px; }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.site-footer li { padding: 3px 0; }
.copyright { text-align: center; color: var(--muted); font-size: .85rem; padding: 20px var(--gutter) 32px; border-top: 1px solid var(--line); }

/* Responsive */
@media (max-width: 960px) {
  .site-header { grid-template-columns: 1fr auto; padding: 18px var(--gutter); gap: 14px; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .logo-moon { width: 64px; }
  .product { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .hero, .hero-2, .hero-4 { grid-template-columns: 1fr; min-height: 0; }
  .hero-tile { min-height: 240px; }
  .hero-label { padding-bottom: 32px; }
  .brand { gap: 10px; } .logo-moon { width: 52px; }
  .lang-switch { gap: 8px; font-size: .8rem; }
  .cart-row { grid-template-columns: 64px 1fr 64px; }
  .cart-total { grid-column: 2 / -1; text-align: left; }
  .footer-grid { grid-template-columns: 1fr; }
  .summary { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Imágenes dentro de páginas */
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose figure { margin: 2em 0; }
.prose figure img { margin: 0 auto; }
.prose figcaption { text-align: center; color: var(--muted); font-size: .85rem; margin-top: .5em; }
.page-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px; margin-bottom: 1.5em; }
@media (min-width: 721px) {
  .prose figure.img-left { float: left; width: 45%; margin: .4em 1.6em 1em 0; }
  .prose figure.img-right { float: right; width: 45%; margin: .4em 0 1em 1.6em; }
  .prose h2, .prose::after { clear: both; }
  .prose::after { content: ""; display: block; }
}

/* Portada con 5-6 categorías: dos filas de tres */
.hero-5, .hero-6 { grid-template-columns: repeat(3, 1fr); min-height: 0; }
.hero-5 .hero-tile, .hero-6 .hero-tile { min-height: clamp(240px, 28vw, 380px); }
@media (max-width: 720px) { .hero-5, .hero-6 { grid-template-columns: 1fr; } }

/* Redes sociales */
@media (min-width: 961px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.social-list { display: flex; gap: 12px; flex-wrap: wrap; }
.social-list a { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--fg); transition: background .15s, color .15s, border-color .15s; }
.social-list a:hover { background: var(--fg); color: #111; border-color: var(--fg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Volver arriba (solo móvil y tablet) */
.to-top { display: none; }
@media (max-width: 960px) {
  .to-top { display: grid; place-items: center; position: fixed; z-index: 40; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--fg); color: #111; box-shadow: 0 8px 24px rgba(0,0,0,.45); cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
  .to-top.show { opacity: 1; transform: none; pointer-events: auto; }
  .to-top:active { transform: scale(.94); }
  .cookie-banner:not([hidden]) ~ .to-top { display: none; }
}

/* Logo */
.site-header { --logo-h: 64px; }
.site-header.logo-sm { --logo-h: 44px; }
.site-header.logo-lg { --logo-h: 92px; }
.logo-img { height: var(--logo-h); width: auto; flex: none; object-fit: contain; }
@media (min-width: 961px) {
  .site-header.logo-center { grid-template-columns: 1fr auto 1fr; grid-template-areas: "search brand actions"; }
  .logo-center .search { grid-area: search; justify-self: start; max-width: 400px; }
  .logo-center .brand { grid-area: brand; justify-self: center; }
  .logo-center .header-actions { grid-area: actions; justify-self: end; }
}
@media (max-width: 960px) { .logo-img { height: min(var(--logo-h), 52px); } }
@media (max-width: 720px) { .logo-img { height: min(var(--logo-h), 42px); }  }

/* Móvil: idioma encima del logo y el nombre */
@media (max-width: 720px) {
  .site-header { grid-template-columns: 1fr auto auto auto; grid-template-areas: "lang lang lang lang" "brand acct cart menu" "search search search search"; gap: 10px 8px; padding-top: 12px; }
  .header-actions { display: contents; }
  .lang-switch { grid-area: lang; justify-self: start; gap: 14px; font-size: .85rem; }
  .lang-switch a { padding: 4px 0; }
  .brand { grid-area: brand; min-width: 0; }
  #menu-open { grid-area: menu; }
  .account-link { grid-area: acct; }
  .cart-link { grid-area: cart; }
  .search { grid-area: search; }
}

/* Móvil: nombre de la tienda más pequeño y con aire */
@media (max-width: 720px) {
  .brand { gap: 8px; padding-right: 6px; } .logo-moon { width: 46px; }
  .brand-name { font-size: clamp(.62rem, calc((100vw - 236px) / 8.8), 1.3rem); line-height: 1; letter-spacing: .02em; white-space: nowrap; }
  .logo-img { height: min(var(--logo-h), 38px); }
  .header-actions .icon-btn, .site-header .icon-btn { padding: 6px 5px; }
}

/* Móviles muy estrechos: logo algo menor para que el nombre siga cabiendo en una línea */
@media (max-width: 360px) { .logo-img { height: min(var(--logo-h), 30px); } .brand { gap: 6px; } .brand-name { font-size: clamp(.62rem, calc((100vw - 226px) / 8.8), 1.3rem); } }

/* Jerarquía de categorías */
.cat-menu > li > a { font-weight: 500; }
.sub-menu { margin: 0 0 6px 4px; padding-left: 14px; border-left: 1px solid var(--line); }
.sub-menu li a { font-size: 1rem; color: var(--muted); padding: 5px 0; }
.sub-menu li a:hover { color: var(--accent); }
.drawer a[aria-current="page"] { color: var(--accent); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-size: .9rem; color: var(--muted); margin: 0 0 14px; }
.breadcrumb a:hover { color: var(--accent); } .breadcrumb [aria-current] { color: var(--fg); }
.subcats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: -6px 0 28px; }
.subcats .chip { padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; font-size: .95rem; }
.subcats .chip:hover { border-color: var(--fg); color: var(--fg); }
.subcats .chip.on { background: var(--fg); color: #111; border-color: var(--fg); }
.crumb span { opacity: .6; }

/* Paginación */
.pagination { margin: 36px 0 8px; }
.pagination ul { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.pagination li a, .pagination li > span:not([hidden]), .pagination li.disabled { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: .95rem; transition: background .15s, border-color .15s; }
.pagination li a:hover { border-color: var(--fg); color: var(--fg); }
.pagination li.current > span { background: var(--fg); color: #111; border-color: var(--fg); font-weight: 500; }
.pagination li.disabled { opacity: .35; }
.pagination li.gap { color: var(--muted); padding: 0 2px; }
.range { margin: -6px 0 18px; }
@media (max-width: 520px) { .pagination li.edge span { display: none; } .pagination li.edge { } .pagination ul { gap: 6px; } }

/* Espacio entre la cuadrícula y el botón «Ver todo» */
.more { margin: clamp(32px, 5vw, 56px) 0 0; }

/* Móvil: dos productos por fila (en lugar de uno enorme) */
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .card-media { aspect-ratio: 4 / 5; }
  .card-body { padding-top: 10px; }
  .card-body h3 { font-size: .92rem; line-height: 1.25; }
  .card .price { font-size: .88rem; line-height: 1.35; }
  .card .price s { margin-right: 4px; }
  .tag { top: 8px; right: 8px; padding: 1px 8px; font-size: .68rem; }
}

/* Móvil: la barra de anuncio en una sola línea (app.js reduce la letra si el texto es largo) */
@media (max-width: 720px) {
  .announcement { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; padding: 10px var(--gutter); }
}

/* Ficha de producto: las miniaturas nunca ensanchan la columna (se desplazan dentro de su fila) */
.gallery, .product-info { min-width: 0; }
.thumbs { max-width: 100%; }
.thumbs .thumb { flex: 0 0 auto; }
.product-info .prose, .product-info h1 { overflow-wrap: anywhere; }

/* Pie: las secciones de páginas van en columnas dentro de su bloque */
.footer-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 28px 32px; align-content: start; }
@media (min-width: 961px) { .footer-grid { grid-template-columns: 1.1fr 2.3fr .8fr .8fr; } }