/* Ruztiko — homepage category sections, 5 layout "directions".
   Each category (.ruz-cat) picks its own direction (sections.home_direction) so the
   catalog doesn't look monotonous across many categories:
     1 Vitrina   — showroom grid, name/price on a paper shelf, actions always visible
     2 Mosaico   — editorial mosaic, the first piece runs large, the rest fill in
     3 Contacto  — archival contact sheet, ruled cells, mono price
     4 Pasarela  — horizontal scroll-snap rail, ideal for long categories / mobile
     5 Etiqueta  — product shot on a warm band with a hanging kraft price tag
   Ported from the Claude Design demo ("Secciones de categoría" / category-section.js).
   All selectors scoped under .ruz-cat so they can't collide with catalogo.css.
   Lives inside .ruz-app, so box-sizing is inherited. The shared section header
   (.ruz-cat-head / -eyebrow / -name / -intro) is styled in catalogo.css. */

.ruz-cat{
  --paper:#fdf9ee; --ink:#241710; --ink-soft:#3a2418; --text:#5a4a3a;
  --rust:#a0552a; --gold:#d49a3f; --gold-soft:#f0c372;
  --line:#e6dcc6; --line2:#d8cbb5; --line3:#c9b89a; --img:#e8e0cd;
  --mono:'Geist Mono',ui-monospace,monospace;
}
.ruz-cat a{color:inherit;text-decoration:none}
.ruz-cat img{display:block;max-width:100%}

/* ===== shared header aside (count + rail tools) ===== */
.ruz-cat-aside{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.ruz-cat-count{font-family:var(--mono);font-size:11px;letter-spacing:0.1em;text-transform:uppercase;color:#9a8b76;white-space:nowrap}

/* ===== status tag (availability) ===== */
.ruz-cat .tag{position:absolute;top:11px;left:11px;z-index:3;pointer-events:none;
  font-size:10px;font-weight:700;letter-spacing:0.12em;text-transform:uppercase;
  padding:5px 10px;border-radius:3px;box-shadow:0 2px 9px rgba(20,12,8,0.3)}
.ruz-cat .tag.pedido{color:var(--paper);background:var(--ink);border:1px solid rgba(253,249,238,0.16)}
.ruz-cat .tag.disponible{color:var(--ink);background:#f5b730;border:1px solid rgba(36,23,16,0.18);
  box-shadow:0 2px 11px rgba(214,150,40,0.5),0 1px 3px rgba(20,12,8,0.25)}
.ruz-cat .tag.vendido{color:var(--paper);background:#8a4a3a;border:1px solid rgba(253,249,238,0.16)}

/* ===== seal sizing (positioning lives in seal.css; default corner tl) =====
   Sized proportional to each card image (% of its wrapper) with a legible px floor and
   ceiling, so the seal stays consistent across directions AND breakpoints. Fixed px
   looked tiny on the big cards (Vitrina/Contacto/Pasarela/Etiqueta) and shrank
   inconsistently on mobile. aspect-ratio keeps the badge square while width drives size,
   so the % auto-resolves against each card's rendered width (no per-breakpoint tuning). */
.ruz-cat .ruz-seal{height:auto;aspect-ratio:1;--seal-size:clamp(104px,30%,148px);--seal-off:11px;z-index:3}

.ruz-cat.ruz-cat--etiqueta .ruz-seal,
.ruz-cat.ruz-cat--contacto .ruz-seal,
.ruz-cat.ruz-cat--vitrina .ruz-seal {
    --seal-size: clamp(72px, 30%, 90px);
}
/* Mosaico tiles are letterbox (fixed ~200px tall, wide), so % of width overshoots their
   height — size the small tiles tighter, and give the tall hero its own band. */
.ruz-cat--mosaico .m-tile .ruz-seal{--seal-size:clamp(90px,23%,96px);--seal-off:12px}
.ruz-cat--mosaico .m-tile.hero .ruz-seal{--seal-size:clamp(124px,20%,150px);--seal-off:16px}

/* ===== shared cover link (whole image clickable) ===== */
.ruz-cat .v-cover,.ruz-cat .m-cover,.ruz-cat .c-cover,.ruz-cat .p-cover,.ruz-cat .e-cover{
  position:absolute;inset:0;z-index:1;cursor:pointer}
.ruz-cat [data-lb]{cursor:zoom-in}

/* ===== shared image fill (works with ruz_img_tag's <picture> or bare <img>) ===== */
.ruz-cat .v-imgwrap picture,.ruz-cat .c-imgwrap picture,.ruz-cat .p-imgwrap picture,
.ruz-cat .e-imgwrap picture,.ruz-cat .m-tile picture{display:block;width:100%;height:100%}
.ruz-cat .v-imgwrap img,.ruz-cat .c-imgwrap img,.ruz-cat .p-imgwrap img,
.ruz-cat .e-imgwrap img,.ruz-cat .m-tile img{width:100%;height:100%;object-fit:cover;
  transition:transform .45s cubic-bezier(.2,.7,.2,1)}

/* ===== "ver más" (reveals pieces beyond the first 4) ===== */
.ruz-cat:not(.is-expanded) [data-extra="1"]{display:none}
.ruz-cat-more{display:flex;justify-content:center;margin-top:28px}
.ruz-cat-more button{font-family:inherit;font-size:13px;font-weight:650;letter-spacing:0.02em;color:var(--ink);
  background:transparent;border:1px solid var(--line2);padding:13px 26px;border-radius:2px;cursor:pointer;
  display:inline-flex;align-items:center;gap:10px;transition:background .15s,border-color .15s}
.ruz-cat-more button:hover{background:var(--paper);border-color:var(--line3)}
.ruz-cat-more button .c{font-family:var(--mono);font-size:11px;color:#9a8b76}

/* ===================================================================
   DIR 1 — VITRINA (showroom grid · caption below on paper)
   =================================================================== */
.ruz-cat .v-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}
.ruz-cat .v-card{background:var(--paper);border:1px solid var(--line);display:flex;flex-direction:column;transition:border-color .18s}
.ruz-cat .v-card:hover{border-color:var(--line3)}
.ruz-cat .v-imgwrap{position:relative;aspect-ratio:1/1;background:var(--img);overflow:hidden}
.ruz-cat .v-card:hover .v-imgwrap img{transform:scale(1.04)}
.ruz-cat .v-acts{position:absolute;right:10px;bottom:10px;z-index:2;display:flex;gap:7px}
@media(hover:hover) and (pointer:fine){
  .ruz-cat .v-acts{opacity:0;transform:translateY(6px);transition:opacity .2s,transform .2s}
  .ruz-cat .v-card:hover .v-acts{opacity:1;transform:none}
}
.ruz-cat .v-share{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;
  background:var(--paper);color:var(--ink);border:0;cursor:pointer;border-radius:2px;box-shadow:0 2px 8px rgba(20,12,8,.25)}
.ruz-cat .v-share svg{width:14px;height:14px}
.ruz-cat .v-wa{height:34px;display:inline-flex;align-items:center;gap:7px;padding:0 13px;background:var(--ink);
  color:var(--paper);font-size:12.5px;font-weight:650;border-radius:2px;box-shadow:0 2px 8px rgba(20,12,8,.25)}
.ruz-cat .v-wa:hover{background:var(--ink-soft)}
.ruz-cat .v-foot{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:14px 15px 15px;border-top:1px solid var(--line)}
.ruz-cat .v-name{font-size:14.5px;font-weight:600;letter-spacing:-0.012em;line-height:1.25}
.ruz-cat .v-price{font-family:var(--mono);font-size:13px;font-weight:500;color:var(--rust);white-space:nowrap}
.ruz-cat .v-price.is-ask{color:#9a8b76;font-size:12px;letter-spacing:0.06em;text-transform:uppercase}

/* ===================================================================
   DIR 2 — MOSAICO (editorial · first piece large)
   =================================================================== */
.ruz-cat .m-grid{display:grid;grid-template-columns:repeat(4,1fr);grid-auto-rows:200px;gap:14px}
.ruz-cat .m-tile{position:relative;overflow:hidden;background:var(--img);border:1px solid var(--line);display:block}
.ruz-cat .m-tile.hero{grid-column:span 2;grid-row:span 2}
.ruz-cat .m-tile:hover img{transform:scale(1.045)}
.ruz-cat .m-plate{position:absolute;left:0;right:0;bottom:0;z-index:2;padding:46px 16px 15px;pointer-events:none;
  background:linear-gradient(to top,rgba(20,12,8,0.8),rgba(20,12,8,0.18) 62%,transparent);color:var(--paper);
  display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.ruz-cat .m-name{font-size:16px;font-weight:600;letter-spacing:-0.015em;line-height:1.2}
.ruz-cat .m-tile.hero .m-name{font-size:clamp(20px,2.2vw,30px)}
.ruz-cat .m-price{display:block;margin-top:5px;font-family:var(--mono);font-size:13px;color:var(--gold-soft);font-weight:500}
.ruz-cat .m-price.is-ask{color:rgba(253,249,238,0.72);font-size:12px;letter-spacing:0.06em;text-transform:uppercase}
.ruz-cat .m-acts{display:flex;gap:7px;flex:0 0 auto;pointer-events:auto}
@media(hover:hover) and (pointer:fine){
  .ruz-cat .m-acts{opacity:0;transform:translateY(6px);transition:opacity .2s,transform .2s}
  .ruz-cat .m-tile:hover .m-acts{opacity:1;transform:none}
}
.ruz-cat .m-share{width:33px;height:33px;display:inline-flex;align-items:center;justify-content:center;
  background:rgba(253,249,238,0.16);backdrop-filter:blur(3px);border:1px solid rgba(253,249,238,.4);
  color:var(--paper);cursor:pointer;border-radius:2px}
.ruz-cat .m-share svg{width:13px;height:13px}
.ruz-cat .m-wa{width:33px;height:33px;display:inline-flex;align-items:center;justify-content:center;
  background:var(--paper);color:var(--ink);border-radius:2px}
.ruz-cat .m-wa svg{width:14px;height:14px}

/* ===================================================================
   DIR 3 — CONTACTO (contact sheet · archival ledger)
   =================================================================== */
.ruz-cat .c-sheet{border:1px solid var(--line2);background:var(--paper)}
.ruz-cat .c-grid{display:grid;grid-template-columns:repeat(4,1fr)}
.ruz-cat .c-cell{position:relative;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:15px;display:flex;flex-direction:column}
.ruz-cat .c-grid .c-cell:nth-child(4n){border-right:0}
.ruz-cat .c-imgwrap{position:relative;aspect-ratio:4/3;background:var(--img);overflow:hidden;margin-bottom:13px}
.ruz-cat .c-cell:hover .c-imgwrap img{transform:scale(1.04)}
.ruz-cat .c-ledger{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding-bottom:9px;border-bottom:1px solid var(--ink);margin-bottom:11px}
.ruz-cat .c-name{font-size:14px;font-weight:600;letter-spacing:-0.01em;line-height:1.25}
.ruz-cat .c-sku{font-family:var(--mono);font-size:10px;letter-spacing:0.08em;color:#9a8b76;text-transform:uppercase;margin-top:3px}
.ruz-cat .c-price{font-family:var(--mono);font-size:13px;color:var(--rust);font-weight:500;white-space:nowrap}
.ruz-cat .c-price.is-ask{color:#9a8b76;font-size:11px;letter-spacing:0.06em;text-transform:uppercase}
.ruz-cat .c-acts{display:flex;gap:8px;margin-top:auto}
.ruz-cat .c-share{width:38px;height:36px;display:inline-flex;align-items:center;justify-content:center;
  background:transparent;color:var(--ink);border:1px solid var(--line2);cursor:pointer;border-radius:2px;transition:background .15s}
.ruz-cat .c-share:hover{background:#f4ede0}
.ruz-cat .c-share svg{width:14px;height:14px}
.ruz-cat .c-wa{flex:1;height:36px;display:inline-flex;align-items:center;justify-content:center;gap:7px;
  background:var(--ink);color:var(--paper);font-size:12.5px;font-weight:650;border-radius:2px}
.ruz-cat .c-wa:hover{background:var(--ink-soft)}

/* ===================================================================
   DIR 4 — PASARELA (horizontal scroll-snap rail)
   =================================================================== */
.ruz-cat--pasarela .ruz-cat-aside.p-tools{gap:20px}
.ruz-cat .p-nav{display:flex;gap:8px}
.ruz-cat .p-arrow{width:44px;height:44px;border:1px solid var(--line2);background:var(--paper);color:var(--ink);
  border-radius:50%;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background .15s,border-color .15s}
.ruz-cat .p-arrow:hover{background:#f4ede0;border-color:var(--line3)}
.ruz-cat .p-arrow svg{width:18px;height:18px}
.ruz-cat .p-rail{display:flex;gap:18px;overflow-x:auto;scroll-snap-type:x mandatory;
  padding:4px 32px 18px;margin:0 -32px;scroll-padding-left:32px;-webkit-overflow-scrolling:touch}
.ruz-cat .p-rail::-webkit-scrollbar{height:7px}
.ruz-cat .p-rail::-webkit-scrollbar-track{background:transparent}
.ruz-cat .p-rail::-webkit-scrollbar-thumb{background:var(--line3);border-radius:4px}
.ruz-cat .p-card{flex:0 0 290px;scroll-snap-align:start;background:var(--paper);border:1px solid var(--line);display:flex;flex-direction:column;transition:border-color .18s}
.ruz-cat .p-card:hover{border-color:var(--line3)}
.ruz-cat .p-imgwrap{position:relative;aspect-ratio:3/4;background:var(--img);overflow:hidden}
.ruz-cat .p-card:hover .p-imgwrap img{transform:scale(1.04)}
.ruz-cat .p-body{padding:15px 16px 16px;display:flex;flex-direction:column;gap:13px}
.ruz-cat .p-line{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.ruz-cat .p-name{font-size:15px;font-weight:600;letter-spacing:-0.012em;line-height:1.25}
.ruz-cat .p-price{font-family:var(--mono);font-size:13px;font-weight:500;color:var(--rust);white-space:nowrap}
.ruz-cat .p-price.is-ask{color:#9a8b76;font-size:12px;letter-spacing:0.06em;text-transform:uppercase}
.ruz-cat .p-acts{display:flex;gap:8px}
.ruz-cat .p-share{width:42px;height:38px;display:inline-flex;align-items:center;justify-content:center;
  background:transparent;color:var(--ink);border:1px solid var(--line2);cursor:pointer;border-radius:2px;transition:background .15s}
.ruz-cat .p-share:hover{background:#f4ede0}
.ruz-cat .p-share svg{width:14px;height:14px}
.ruz-cat .p-wa{flex:1;height:38px;display:inline-flex;align-items:center;justify-content:center;gap:7px;
  background:var(--ink);color:var(--paper);font-size:12.5px;font-weight:650;border-radius:2px}
.ruz-cat .p-wa:hover{background:var(--ink-soft)}

/* ===================================================================
   DIR 5 — ETIQUETA DE TALLER (product shot · contact shadow · kraft swing tag)
   =================================================================== */
.ruz-cat--etiqueta{background:linear-gradient(180deg,#efe6d4,#e7dcc4)}
.ruz-cat .e-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:30px 22px}
.ruz-cat .e-card{display:flex;flex-direction:column}
.ruz-cat .e-stage{position:relative;padding:4px 4px 22px}
.ruz-cat .e-imgwrap{position:relative;aspect-ratio:1/1;background:var(--paper);overflow:hidden;border:1px solid var(--line)}
.ruz-cat .e-card:hover .e-imgwrap img{transform:scale(1.045)}
.ruz-cat .e-stage::after{content:"";position:absolute;left:13%;right:13%;bottom:7px;height:16px;
  background:radial-gradient(ellipse at center,rgba(20,12,8,0.3),transparent 72%);filter:blur(1px)}
.ruz-cat .e-swing{position:absolute;top:16px;right:14px;z-index:4;transform:rotate(3deg);transform-origin:top center;
  background:#e7d7b3;color:var(--ink);font-family:var(--mono);font-size:12.5px;font-weight:600;letter-spacing:0.02em;
  padding:8px 13px 8px 19px;border-radius:3px;box-shadow:0 4px 12px rgba(20,12,8,0.26);
  clip-path:polygon(13px 0,100% 0,100% 100%,13px 100%,0 50%)}
.ruz-cat .e-swing::before{content:"";position:absolute;left:6px;top:50%;width:5px;height:5px;border-radius:50%;
  background:rgba(36,23,16,0.42);transform:translateY(-50%)}
.ruz-cat .e-swing.is-ask{font-size:11px;letter-spacing:0.08em;text-transform:uppercase;color:#6b5942}
.ruz-cat .e-foot{padding:0 4px;display:flex;flex-direction:column;gap:12px}
.ruz-cat .e-name{font-size:15px;font-weight:600;letter-spacing:-0.012em;line-height:1.3}
.ruz-cat .e-acts{display:flex;gap:8px}
.ruz-cat .e-share{width:42px;height:36px;display:inline-flex;align-items:center;justify-content:center;
  background:var(--paper);color:var(--ink);border:1px solid var(--line2);cursor:pointer;border-radius:2px;transition:background .15s}
.ruz-cat .e-share:hover{background:#f4ede0}
.ruz-cat .e-share svg{width:14px;height:14px}
.ruz-cat .e-wa{flex:1;height:36px;display:inline-flex;align-items:center;justify-content:center;gap:7px;
  background:var(--ink);color:var(--paper);font-size:12.5px;font-weight:650;border-radius:2px}
.ruz-cat .e-wa:hover{background:var(--ink-soft)}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media(max-width:1100px){
  .ruz-cat .v-grid,.ruz-cat .m-grid,.ruz-cat .c-grid,.ruz-cat .e-grid{grid-template-columns:repeat(3,1fr)}
  .ruz-cat .c-grid .c-cell:nth-child(4n){border-right:1px solid var(--line)}
  .ruz-cat .c-grid .c-cell:nth-child(3n){border-right:0}
}
@media(max-width:820px){
  .ruz-cat .v-grid,.ruz-cat .m-grid,.ruz-cat .c-grid,.ruz-cat .e-grid{grid-template-columns:repeat(2,1fr)}
  .ruz-cat .c-grid .c-cell:nth-child(3n){border-right:1px solid var(--line)}
  .ruz-cat .c-grid .c-cell:nth-child(2n){border-right:0}
  .ruz-cat .m-tile.hero{grid-column:span 2;grid-row:span 1}
    .ruz-cat--mosaico .m-tile.hero .ruz-seal {
        --seal-size: clamp(90px, 23%, 96px);
    }
}
@media(max-width:720px){
  .ruz-cat .p-rail{margin:0 -18px;padding-left:18px;padding-right:18px}
}
@media(max-width:560px){
  .ruz-cat .v-grid,.ruz-cat .m-grid,.ruz-cat .c-grid,.ruz-cat .e-grid{grid-template-columns:1fr}
  .ruz-cat .c-grid .c-cell{border-right:0}
  .ruz-cat .m-tile.hero{grid-column:span 1}
  .ruz-cat .p-card{flex-basis:78vw}

    .ruz-cat--mosaico .m-tile .ruz-seal,
    .ruz-cat--mosaico .m-tile.hero .ruz-seal,
    .ruz-cat .ruz-seal{
        --seal-size: clamp(74px, 26%, 89px);
    }
}
