.linkish { padding: 0; border: 0; background: none; font: inherit; color: var(--cherry); text-decoration: underline; cursor: pointer; }

/* ---------- Hero ---------- */
.sab-hero { min-height: 88svh; }
.sab-hero .bg { object-position: 60% 40%; }
.sab-copy { position: relative; z-index: 2; max-width: 40rem; padding: calc(var(--nav-h) + 13vh) var(--gx) 4rem; }
.sab-copy .btn { margin-top: 2rem; }

/* ---------- Barra del catálogo (título, buscador y filtros) ---------- */
.catalog { --tools-h: 9.6rem; padding-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: 8rem; }
.cat-head { display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: end; padding: 1.2rem 0 1.4rem; border-bottom: 1px solid var(--line); position: sticky; top: var(--nav-h); z-index: 5; background: rgba(244,241,234,.95); }
.cat-head .h2 { font-size: clamp(1.8rem, 3.4vw, 3.2rem); }
.cat-tools { display: grid; gap: .8rem; justify-items: end; }
.search { display: flex; align-items: center; gap: .6rem; width: min(30rem, 80vw); padding: .75rem 1rem; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px rgba(15,31,23,.18); }
.search:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ink-soft); stroke-width: 2; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 1rem; color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.filters button { min-height: 40px; padding: .45rem .9rem; border: 1.5px solid rgba(15,31,23,.22); border-radius: 999px; background: transparent; font: inherit; font-size: .84rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* ---------- Líneas de producto ---------- */
.group { padding-top: clamp(2.4rem, 5vw, 4rem); scroll-margin-top: calc(var(--nav-h) + var(--tools-h)); }
.group[hidden] { display: none; }
.group-aside { margin-bottom: 1.4rem; }
.group-art { margin: 0 0 1.4rem; aspect-ratio: 21 / 8; overflow: hidden; }
/* Sin marco: la pintura de cada línea se funde con el paisaje de fondo */
.group-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 72%; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 52%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 52%, transparent 100%); }
.group:hover .group-art img { transform: scale(1.03); }
.group-head h3 { margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(1.9rem, 3vw, 2.8rem); line-height: 1; }
.group-head p { margin: .5rem 0 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.5; }
.group-head .count { display: inline-block; margin-top: .9rem; font-family: var(--mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }

/* Cuadrícula simétrica: 4 columnas (2 en celular). Cada línea tiene un múltiplo de 4 productos,
   así las filas siempre quedan completas, y ocupa todo el ancho disponible. */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.6rem, 1.2vw, 1.2rem); }
.item { position: relative; display: grid; grid-template-rows: auto 1fr; padding: 0; border: 0; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font: inherit; text-align: left; color: var(--ink); cursor: pointer; overflow: hidden; transition: transform .25s, box-shadow .25s, background .25s, color .25s; }
.item[hidden] { display: none; }
.item .pic { display: block; aspect-ratio: 1; overflow: hidden; background: #f1ece1; }
.item .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1), filter .3s; }
.item .meta { display: grid; gap: .6rem; padding: .8rem 1rem .9rem; }
.item.no-pic .pic { display: none; }
.item.no-pic { grid-template-rows: 1fr; min-height: 132px; }
.item.no-pic .meta { align-content: space-between; gap: 1.6rem; padding-top: 1rem; }
.item.no-pic::before { content: attr(data-initial); position: absolute; right: -.1rem; bottom: -1.6rem; font-family: var(--serif); font-style: italic; font-size: 6.2rem; line-height: 1; color: var(--tint); opacity: .14; }
@media (hover: hover) {
  .item:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line), 0 14px 30px -18px rgba(15,31,23,.5); }
  .item:hover .pic img { transform: scale(1.06); }
}
.item .name { position: relative; font-family: var(--serif); font-size: clamp(1.05rem, 1.3vw, 1.3rem); line-height: 1.1; }
.item .add { position: relative; display: inline-flex; align-items: center; gap: .4rem; font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.item .add i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--tint); color: #fff; font-style: normal; font-size: .95rem; transition: transform .3s; }
.item[aria-pressed="true"] { background: var(--ink); color: var(--cream); box-shadow: none; }
.item[aria-pressed="true"] .pic img { filter: saturate(1.1) brightness(.92); }
.item[aria-pressed="true"] .add { color: rgba(244,241,234,.75); }
.item[aria-pressed="true"] .add i { transform: rotate(45deg); background: var(--cherry); }
.item[aria-pressed="true"]::before { color: #fff; opacity: .12; }
.item.pop { animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 40% { transform: scale(.95); } }

.empty { margin: 3rem 0 0; font-size: 1.05rem; color: var(--ink-soft); }

/* Pantallas anchas: la pintura y el título de cada línea van en una columna fija a la izquierda
   y los productos ocupan todo el resto del ancho. */
@media (min-width: 1100px) {
  .group { display: grid; grid-template-columns: clamp(260px, 25vw, 440px) minmax(0, 1fr); gap: clamp(1.6rem, 3vw, 3.2rem); align-items: start; }
  .group-aside { position: sticky; top: calc(var(--nav-h) + var(--tools-h) + 1.4rem); margin: 0; }
  .group-art { aspect-ratio: 4 / 5; }
  .group-art img { object-position: 50% 60%; }
}

/* ---------- Panel "Mi lista": se abre desde el botón flotante ---------- */
.tray { position: fixed; z-index: 46; right: clamp(14px, 2.4vw, 28px); bottom: calc(clamp(14px, 2.4vw, 28px) + 52px * 2 + 1.2rem); width: min(560px, calc(100% - 28px)); max-height: min(78vh, 720px); display: flex; flex-direction: column; border-radius: 20px; background: var(--ink); color: var(--cream); box-shadow: 0 24px 60px -20px rgba(15,31,23,.7); transform-origin: 100% 100%; opacity: 0; visibility: hidden; transform: translateY(12px) scale(.97); transition: opacity .25s, transform .3s cubic-bezier(.2,.7,.2,1), visibility 0s .3s; }
.tray[data-open="true"] { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .3s cubic-bezier(.2,.7,.2,1); }
/* Abrir Mi lista: el panel crece como un círculo desde el botón y las filas entran en cascada */
@supports (clip-path: circle(1% at 100% 100%)) {
  .tray { opacity: 1; transform: none; clip-path: circle(0% at calc(100% - 26px) calc(100% + 60px)); transition: clip-path .5s cubic-bezier(.6,0,.2,1), visibility 0s .5s; }
  .tray[data-open="true"] { clip-path: circle(150% at calc(100% - 26px) calc(100% + 60px)); transition: clip-path .65s cubic-bezier(.2,.8,.2,1); }
}
.tray.is-opening .tray-group, .tray.is-opening .row { animation: rowIn .45s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.12s + var(--i, 0) * 35ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px); } }
/* Al agregar un producto, su pintura vuela hasta Mi lista */
.fly { position: fixed; z-index: 60; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 10px 24px -8px rgba(15,31,23,.5); pointer-events: none; }
.btn-down span { display: inline-block; transition: transform .3s; }
.btn-down:hover span { transform: translateY(3px); }
.tray-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: 1rem 1rem 1rem 1.2rem; border-bottom: 1px solid rgba(244,241,234,.14); }
.tray-count { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 .4rem; border-radius: 999px; background: var(--cherry); font-weight: 800; }
#tray-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 1.35rem; line-height: 1.1; }
.tray-hint { margin: .15rem 0 0; font-size: .8rem; color: rgba(244,241,234,.6); }
.tray-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(244,241,234,.1); color: var(--cream); font-size: 1.4rem; cursor: pointer; }
.tray-close:hover { background: rgba(244,241,234,.2); }
.tray-body, .tray-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
/* Columnas de Mi lista: miniatura · producto · cantidad · unidad · quitar */
.tray { --cols: 40px minmax(0, 1fr) 4.6rem 7.4rem 40px; }
.tray-cols { display: grid; grid-template-columns: var(--cols); gap: .6rem; padding: .7rem 1.2rem .4rem; font-family: var(--mono); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(244,241,234,.5); }
.tray-cols span:first-child { grid-column: 1 / 3; }
.tray-cols[hidden] { display: none; }
.tray-items { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; margin: 0; padding: 0 1.2rem .4rem; list-style: none; }
.tray-items:empty::before { content: "Toca un producto del catálogo para agregarlo aquí."; display: block; padding: 1.2rem 0; font-size: .92rem; color: rgba(244,241,234,.6); }
.tray-group { display: flex; justify-content: space-between; align-items: baseline; padding: .9rem 0 .35rem; border-bottom: 1px solid rgba(244,241,234,.14); font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: #9fd3a9; }
.tray-group b { font-weight: 700; color: rgba(244,241,234,.55); }
.tray-items .row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid rgba(244,241,234,.08); }
.tray-items .thumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: rgba(244,241,234,.92); }
.tray-items .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray-items .nm { font-size: .95rem; line-height: 1.2; overflow-wrap: anywhere; }
.tray-items input, .tray-items select { width: 100%; min-height: 40px; padding: .4rem .6rem; border: 0; border-radius: 8px; background: rgba(244,241,234,.1); color: var(--cream); font: inherit; font-size: 1rem; }
.tray-items input { text-align: right; -moz-appearance: textfield; }
.tray-items input::-webkit-outer-spin-button, .tray-items input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tray-items select { appearance: none; padding-right: 1.6rem; cursor: pointer; background: rgba(244,241,234,.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f4f1ea' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right .6rem center; }
.tray-items select option { color: var(--ink); }
.tray-items input::placeholder { color: rgba(244,241,234,.45); }
.tray-items input:focus-visible, .tray-items select:focus-visible { outline: 2px solid #9fd3a9; outline-offset: 1px; }
.tray-items .x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(244,241,234,.1); color: var(--cream); font-size: 1.1rem; cursor: pointer; }
.tray-actions { display: grid; gap: .5rem; padding: 1rem 1.2rem 1.2rem; border-top: 1px solid rgba(244,241,234,.14); }
.tray-actions .btn { justify-content: center; min-height: 48px; }
.tray .linkish { justify-self: center; min-height: 40px; color: #ffb3bd; font-size: .88rem; }

/* ---------- Tableta y celular ---------- */
@media (max-width: 980px) {
  .sab-hero { min-height: 0; }
  .sab-copy { padding-top: calc(var(--nav-h) + 8svh); padding-bottom: 3rem; }
  .sab-copy .lead { color: var(--ink); }
  .sab-hero .bg { object-position: 24% 40%; } /* el cerezo completo a la vista a la derecha, como antes */
  .sab-copy .lead { max-width: 62%; } /* el texto se queda en el cielo, a la izquierda del cerezo */

  /* Buscador y filtros: barra pegajosa y compacta bajo la navegación (filtros en una fila deslizable) */
  .catalog { --tools-h: 8.2rem; padding-bottom: calc(var(--tab-h) + 6rem); }
  .cat-head { display: contents; }
  .cat-head .h2 { padding-bottom: 1rem; }
  .cat-tools { position: sticky; top: var(--nav-h); z-index: 5; margin-inline: calc(var(--gx) * -1); padding: .55rem var(--gx) .6rem; gap: .5rem; justify-items: stretch; background: rgba(244,241,234,.96); box-shadow: 0 1px 0 var(--line); }
  .search { width: 100%; padding-block: 0; }
  .search input { min-height: 46px; }
  .filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: calc(var(--gx) * -1); padding: 2px var(--gx); scroll-padding-inline: var(--gx); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; min-height: 44px; padding: .5rem 1rem; font-size: .86rem; }
  .linkish { display: inline-block; min-height: 44px; padding-inline: .2rem; }

  /* La lista se abre como hoja inferior sobre la barra de pestañas; los botones flotantes se esconden mientras está abierta */
  .tray { left: 10px; right: 10px; width: auto; bottom: calc(var(--tab-h) + 10px); max-height: calc(100svh - var(--tab-h) - var(--nav-h) - 24px); transform-origin: 50% 100%; }
  body:has(.tray[data-open="true"]) .float { visibility: hidden; }
}
@media (max-width: 560px) {
  .catalog { --tools-h: 7.9rem; }
  .group-art { aspect-ratio: 16 / 9; border-radius: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .item { border-radius: 14px; }
  .item .meta { padding: .65rem .7rem .7rem; gap: .45rem; }
  .item .name { font-size: 1.05rem; overflow-wrap: anywhere; }
  .item.no-pic { min-height: 112px; }
  .item.no-pic::before { font-size: 5rem; bottom: -1.2rem; }
  /* En celular la miniatura sobra: el nombre gana el espacio y las columnas se mantienen */
  .tray { --cols: minmax(0, 1fr) 3.4rem 7rem 40px; }
  .tray-items select { padding: .4rem 1.3rem .4rem .5rem; background-position: right .45rem center; }
  .tray-items input { padding-inline: .45rem; }
  .tray-cols, .tray-items { padding-inline: .9rem; }
  .tray-cols { gap: .45rem; }
  .tray-cols span:first-child { grid-column: 1; }
  .tray-items .row { gap: .45rem; }
  .tray-items .thumb { display: none; }
  .tray-items input, .tray-items select { min-height: 44px; }
  .tray-items .x { width: 40px; height: 44px; border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) { .item, .item .pic img, .tray { transition: none; } .item.pop, .tray.is-opening .row, .tray.is-opening .tray-group { animation: none; } }
/* Celular angosto: el cerezo un poco más adentro para que se vea su copa */
@media (max-width: 480px) { .sab-hero .bg { object-position: 31% 40%; } }
