/* Sección Navidad (catálogo XMAS de Cifra) y su bloque de portada — 28/10/2026.
   Base: propuesta de ChatGPT (encargo 25), con los tamaños y componentes de la
   web (card-grid, pcard, cat-toolbar). */
.xm-hero, .xm-home {
  --xm-ink: hsl(169, 60%, 15%);
  --xm-gold: #e9d3a6;
  --xm-paper: #f7f3ea;
  --lamp-amber: #f1d9a7; --lamp-amber-deep: #e6c588; --lamp-ink: var(--xm-ink);
  background: radial-gradient(80% 120% at 85% 40%, hsl(168, 55%, 19%) 0%, var(--xm-ink) 60%);
  color: #fff;
}
.xm-eyebrow {
  display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--xm-gold);
}

/* cabecera de la sección */
.xm-hero-inner {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--space-7); align-items: center;
  padding-block: var(--space-6);
}
.xm-hero h1 {
  font-family: var(--font-display); font-size: var(--text-3xl); line-height: 1.1;
  letter-spacing: var(--tracking-display); margin: 0 0 var(--space-4); color: #fff; max-width: 15ch;
}
.xm-hero h1 em, .xm-home h2 em { font-style: normal; color: var(--xm-gold); }
.xm-hero-copy > p:not(.xm-eyebrow) { color: hsl(168, 20%, 86%); max-width: 46ch; margin: 0 0 var(--space-5); }
.xm-hero-art { position: relative; height: 270px; max-width: 520px; width: 100%; justify-self: end; }
.xm-piece {
  position: absolute; display: flex; flex-direction: column; gap: 2px;
  background: var(--xm-paper); color: var(--xm-ink); border-radius: var(--radius-lg);
  padding: var(--space-3); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55);
  text-decoration: none; transition: transform .2s ease;
}
.xm-piece:hover { transform: translateY(-3px) rotate(0deg) !important; }
.xm-piece img { width: 100%; height: calc(100% - 44px); object-fit: contain; mix-blend-mode: multiply; }
.xm-piece span { font-size: var(--text-xs); color: var(--gray-500); }
.xm-piece strong { font-size: var(--text-sm); }
.xm-piece-0 { left: 2%; top: 4%; width: 44%; height: 240px; transform: rotate(-4deg); z-index: 2; }
.xm-piece-1 { right: 2%; top: 0; width: 38%; height: 128px; transform: rotate(3deg); }
.xm-piece-2 { right: 6%; bottom: 0; width: 38%; height: 128px; transform: rotate(-1deg); z-index: 3; }

/* ideas para regalar */
.xm-ideas { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--space-3); }
.xm-idea {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--color-text); font: inherit;
}
.xm-idea-img {
  display: block; width: 100%; aspect-ratio: 1; margin-bottom: var(--space-2);
  background: var(--color-bg-subtle); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease;
}
.xm-idea-img img { width: 100%; height: 100%; object-fit: contain; padding: 10%; mix-blend-mode: multiply; }
.xm-idea:hover .xm-idea-img, .xm-idea:focus-visible .xm-idea-img { border-color: var(--brand-400); box-shadow: 0 8px 22px -14px hsl(168 60% 20% / .5); }
.xm-idea strong { font-size: var(--text-sm); line-height: 1.25; }
.xm-idea small { font-size: var(--text-xs); color: var(--color-text-muted); }

/* tarjetas más pequeñas que en el resto de la web: son cientos de ideas */
.xm-ideas-sec { padding-block: var(--space-6); }
.xm-dest-sec { padding-block: var(--space-6); }
#catalog .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
@media (min-width: 1100px) { .xm-dest-sec .card-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.xm-dest-sec .pcard-img, #catalog .pcard-img { aspect-ratio: 1; background: #fff; }
.xm-dest-sec .pcard-img img, #catalog .pcard-img img { object-fit: contain; padding: 8%; }
.xm-dest-sec .pcard-body, #catalog .pcard-body { padding: var(--space-3); }
#catalog .pcard-title { font-size: var(--text-base); }
.xm-dest-sec .pcard-price .amount, #catalog .pcard-price .amount { font-size: var(--text-lg); }

/* tarjetas sin botón: el nombre es el enlace (pedido de Alex) */
.xm-dest-sec .pcard-title, #catalog .pcard-title { transition: color .15s ease; }
.xm-dest-sec .pcard:hover .pcard-title, #catalog .pcard:hover .pcard-title { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
#catalog { scroll-margin-top: 180px; }
#catalog .section-head .sub { margin-top: var(--space-2); }

/* bloque de la portada */
.xm-home { position: relative; }
.xm-home-inner {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-6); align-items: center;
  padding-block: var(--space-6);
}
.xm-home h2 { font-family: var(--font-display); font-size: var(--text-3xl); letter-spacing: var(--tracking-display); color: #fff; margin: 0 0 var(--space-3); }
.xm-home p:not(.xm-eyebrow) { color: hsl(168, 20%, 86%); max-width: 52ch; margin: 0 0 var(--space-5); }
.xm-home .btn { position: relative; z-index: 2; }
.xm-home-fotos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.xm-home-fotos span { display: block; aspect-ratio: 1; background: var(--xm-paper); border-radius: var(--radius-md); overflow: hidden; }
.xm-home-fotos span:nth-child(odd) { transform: translateY(-8px); }
.xm-home-fotos img { width: 100%; height: 100%; object-fit: contain; padding: 10%; mix-blend-mode: multiply; }

@media (max-width: 1100px) {
  .xm-ideas { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4) var(--space-3); }
}
@media (max-width: 800px) {
  .xm-hero-inner { grid-template-columns: 1fr; gap: var(--space-5); padding-block: var(--space-6); }
  .xm-hero-art { height: 230px; }
  .xm-piece-0 { height: 210px; width: 46%; }
  .xm-piece-1 { height: 108px; width: 40%; }
  .xm-piece-2 { height: 108px; width: 40%; right: 4%; }
  .xm-piece-1 span, .xm-piece-2 span { display: none; }
  .xm-piece img { height: calc(100% - 24px); }
  .xm-home-inner { grid-template-columns: 1fr; padding-block: var(--space-5); }
}
@media (max-width: 560px) {
  .xm-dest-sec .card-grid, #catalog .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xm-ideas { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: var(--space-3); padding-bottom: var(--space-2); }
  .xm-idea { flex: 0 0 34%; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) { .xm-piece, .xm-idea-img { transition: none; } }

/* catálogo: ideas en columna lateral y filtros en una barra fina (28/10/2026,
   Alex: «esto es muy cutre» — los chips partían en dos líneas y la caja de
   filtros se estiraba con el desplegable de material) */
.xm-cat { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.xm-cat-side { position: sticky; top: 180px; display: flex; flex-direction: column; gap: 2px; }
.xm-cat-side-title { margin: 0 0 var(--space-2); font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-muted); }
.xm-cat-side .cat-subcats { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.xm-cat-side .cat-subcat-chip, .xm-todas {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: 9px 12px; margin: 0; border: 0; border-radius: var(--radius-sm);
  background: none; box-shadow: none; color: var(--gray-700); font: inherit; font-size: var(--text-sm); font-weight: 600;
  text-align: left; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.xm-cat-side .cat-subcat-chip:hover, .xm-todas:hover { background: var(--color-bg-subtle); }
.xm-cat-side .cat-subcat-chip.is-on, .xm-todas.is-on { background: var(--color-primary-soft); color: var(--brand-700); box-shadow: inset 3px 0 0 var(--brand-600); }
.xm-cat-side .n { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); opacity: 1; }

.xm-cat-main .cat-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5);
  padding: 0 0 var(--space-3); margin: 0 0 var(--space-3);
  border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; background: none; box-shadow: none; min-height: 0;
}
.xm-cat-main .cat-select { width: auto; max-width: 170px; padding-block: 6px; font-size: var(--text-sm); }
.xm-cat-main .cat-swatch { width: 20px; height: 20px; }
.xm-cat-main .cat-swatches { gap: 5px; }
.xm-cat-main .cat-toggle { font-size: var(--text-sm); }
.xm-cat-main .cat-count { margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--color-text-muted); }

@media (max-width: 1000px) {
  .xm-cat { grid-template-columns: 1fr; gap: var(--space-3); }
  .xm-cat-side { position: static; flex-direction: row; overflow-x: auto; gap: var(--space-2); padding-bottom: var(--space-2); scrollbar-width: none; }
  .xm-cat-side::-webkit-scrollbar { display: none; }
  .xm-cat-side-title { display: none; }
  .xm-cat-side .cat-subcats { flex-direction: row; flex-wrap: nowrap; gap: var(--space-2); }
  .xm-cat-side { align-items: center; }
  .xm-cat-side .cat-subcat-chip, .xm-todas { width: auto; flex: none; white-space: nowrap; gap: var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: 7px 14px; }
  .xm-cat-side .cat-subcat-chip.is-on, .xm-todas.is-on { box-shadow: none; border-color: var(--brand-600); background: var(--brand-600); color: #fff; }
  .xm-cat-side .is-on .n { color: #fff; opacity: .8; }
  .xm-cat-main .cat-filters { gap: var(--space-2) var(--space-4); }
  .xm-cat-main .cat-filter-group[style] { margin-left: 0 !important; }
}

/* filtros en una línea y «Ordenar» a la derecha del contador: la barra se
   disuelve (display: contents) y sus grupos se ordenan dentro de la columna */
.xm-cat-main { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-5); row-gap: var(--space-3); }
.xm-cat-main .cat-filters { display: contents; }
.xm-buscar { order: 1; flex: 1 1 260px; max-width: 520px; display: flex; align-items: center; gap: var(--space-2);
  border: 1px solid var(--color-border-input); border-radius: var(--radius-full); padding: 0 var(--space-4); background: #fff; color: var(--gray-500); }
.xm-buscar:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.xm-buscar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 11px 0; font: inherit; font-size: var(--text-base); color: var(--color-text); }
.xm-cat-main .cat-count { order: 2; margin: 0; }
.xm-cat-main .cat-filter-group[style] { order: 3; margin-left: auto !important; }
.xm-cat-main .card-grid { order: 5; flex-basis: 100%; }
.xm-cat-main .cat-empty { order: 6; flex-basis: 100%; }
.xm-cat-main .cat-select { max-width: 150px; padding-block: 5px; }

/* artículos que Cifra sirve sin marcaje */
.badge-sin-marcaje { background: var(--gray-700); color: #fff; }
