/* Add-on Smart Catalog — estructura, estados y accesibilidad. El ASPECTO es de cada web: su site.css define
   .sc { --sc-accent, --sc-accent-hover, --sc-on-accent, --sc-ink, --sc-muted, --sc-line, --sc-soft, --sc-card,
         --sc-radius, --sc-font-display, --sc-ratio } (el build avisa en rojo si falta --sc-accent).
   Tipografía y colores de texto se heredan de la página; sin variables propias queda neutro y legible. */
.sc {
  --sc-accent: #1d2a3a; --sc-accent-hover: color-mix(in srgb, var(--sc-accent) 86%, #000); --sc-on-accent: #fff;
  --sc-ink: currentColor; --sc-muted: color-mix(in srgb, currentColor 66%, transparent);
  --sc-line: color-mix(in srgb, currentColor 14%, transparent); --sc-soft: color-mix(in srgb, currentColor 5%, transparent);
  --sc-card: #fff; --sc-radius: 14px; --sc-font-display: inherit; --sc-ratio: 4 / 5;
  --sc-ok: #1f7a4d; --sc-warn: #a15c07; --sc-bad: #b42318;
  --sc-ease: cubic-bezier(.16, 1, .3, 1);
  color: var(--sc-ink);
  width: min(100% - 32px, 1200px); margin-inline: auto; padding-block: clamp(28px, 5vw, 64px);
}
.sc *, .sc *::before, .sc *::after { box-sizing: border-box; }
.sc .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sc a { color: inherit; }
.sc :focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; border-radius: 4px; }

/* Migas de pan (van antes del bloque, alineadas con él) */
.sc-crumbs { width: min(100% - 32px, 1200px); margin: clamp(16px, 3vw, 28px) auto 0; font-size: .875rem; color: var(--sc-muted, inherit); }
.sc-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35em; }
.sc-crumbs li:not(:last-child)::after { content: '/'; margin-left: .35em; opacity: .5; }
.sc-crumbs a { color: inherit; text-decoration: none; }
.sc-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sc-crumbs [aria-current] { opacity: .8; }
.sc-crumbs + .sc { padding-top: clamp(14px, 2.5vw, 24px); }

/* Listado */
.sc-head { max-width: 62ch; margin-bottom: clamp(20px, 3vw, 32px); }
.sc-title { font-family: var(--sc-font-display); font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); line-height: 1.05; letter-spacing: -.02em; margin: 0; }
.sc-intro { margin: .8em 0 0; font-size: 1.0625rem; line-height: 1.6; color: var(--sc-muted); }
.sc-cats { margin: 0 0 clamp(22px, 3vw, 34px); overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.sc-cats::-webkit-scrollbar { display: none; }
.sc-cats ul { list-style: none; margin: 0; padding: 2px 32px 2px 2px; display: flex; gap: 8px; width: max-content; }
.sc-cats a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--sc-line); text-decoration: none; font-size: .9375rem; white-space: nowrap; transition: background-color .25s var(--sc-ease), border-color .25s var(--sc-ease), color .25s var(--sc-ease); }
.sc-cats a:hover { border-color: color-mix(in srgb, var(--sc-accent) 45%, transparent); }
.sc-cats a[aria-current] { background: var(--sc-accent); border-color: var(--sc-accent); color: var(--sc-on-accent); }

.sc-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(22px, 3vw, 40px) clamp(14px, 2.2vw, 28px); }
@media (min-width: 700px) { .sc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .sc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sc-card a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.sc-card-img { position: relative; margin: 0 0 8px; aspect-ratio: var(--sc-ratio); border-radius: var(--sc-radius); overflow: hidden; background: var(--sc-soft); }
.sc-card-img img, .sc-card-img .sc-noimg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s var(--sc-ease), filter .7s var(--sc-ease); }
.sc-card a:hover .sc-card-img img { transform: scale(1.035); }
.sc-card-name { font-weight: 600; line-height: 1.3; }
.sc-card a:hover .sc-card-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.sc-card-price { font-variant-numeric: tabular-nums; color: var(--sc-muted); }
.sc-card-more { align-self: flex-start; display: inline-flex; align-items: center; min-height: 40px; margin-top: 8px; padding: 0 18px; border: 1px solid var(--sc-accent); border-radius: 999px; color: var(--sc-accent); font-size: .875rem; font-weight: 600; transition: background-color .25s var(--sc-ease), color .25s var(--sc-ease); }
.sc-card a:hover .sc-card-more { background: var(--sc-accent); color: var(--sc-on-accent); }
.sc-badge { position: absolute; left: 10px; top: 10px; padding: 5px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .01em; background: var(--sc-card); color: var(--sc-ink); box-shadow: 0 2px 10px -4px rgba(0, 0, 0, .25); }
.sc-badge.is-out-of-stock { color: var(--sc-bad); }
.sc-badge.is-on-request { color: var(--sc-warn); }
.sc-noimg { display: grid; place-items: center; color: var(--sc-muted); }
.sc-noimg svg { width: 34%; max-width: 64px; fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .5; }
.sc-empty { padding: 48px 0; color: var(--sc-muted); font-size: 1.0625rem; }

.sc-pages { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: clamp(36px, 5vw, 56px); }
.sc-pages ol { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.sc-pages a, .sc-pages span { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 999px; text-decoration: none; font-variant-numeric: tabular-nums; }
.sc-pages a { border: 1px solid var(--sc-line); }
.sc-pages a:hover { border-color: var(--sc-accent); }
.sc-pages [aria-current] { background: var(--sc-accent); color: var(--sc-on-accent); }

/* Detalle */
.sc-pgrid { display: grid; gap: clamp(24px, 4vw, 64px); align-items: start; }
@media (min-width: 900px) { .sc-pgrid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } .sc-gallery { position: sticky; top: 96px; } }
.sc-main { margin: 0; aspect-ratio: var(--sc-ratio); border-radius: var(--sc-radius); overflow: hidden; background: var(--sc-soft); }
.sc-main img, .sc-main .sc-noimg { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-thumbs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sc-thumbs button { display: block; width: 100%; padding: 0; border: 0; border-radius: calc(var(--sc-radius) * .6); overflow: hidden; aspect-ratio: 1; cursor: pointer; background: var(--sc-soft); opacity: .62; outline-offset: 2px; transition: opacity .25s var(--sc-ease), box-shadow .25s var(--sc-ease); }
.sc-thumbs button:hover { opacity: .9; }
.sc-thumbs button[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--sc-accent); }
.sc-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sc-info { display: flex; flex-direction: column; align-items: flex-start; }
.sc-pcat { margin: 0 0 10px; font-size: .9375rem; }
.sc-pcat a { color: var(--sc-muted); text-decoration: none; }
.sc-pcat a:hover { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sc-name { font-family: var(--sc-font-display); font-size: clamp(1.85rem, 1.3rem + 2vw, 2.9rem); line-height: 1.08; letter-spacing: -.02em; margin: 0; }
.sc-price { margin: .55em 0 0; font-size: 1.375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Oferta (como WooCommerce): precio regular tachado y más suave, y el precio de oferta sin subrayado. */
.sc-was { color: var(--sc-muted); font-weight: 400; font-size: .85em; text-decoration: line-through; margin-right: .3em; }
.sc-now { text-decoration: none; }
.sc-avail { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: .9375rem; }
.sc-avail span { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sc-avail.is-in-stock { color: var(--sc-ok); }
.sc-avail.is-out-of-stock { color: var(--sc-bad); }
.sc-avail.is-on-request { color: var(--sc-warn); }

.sc-variants { border: 0; margin: 26px 0 0; padding: 0; min-width: 0; width: 100%; }
.sc-variants legend { padding: 0; margin: 0 0 10px; font-weight: 600; font-size: .9375rem; }
.sc-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-opt { position: relative; cursor: pointer; }
.sc-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sc-opt span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--sc-line); border-radius: calc(var(--sc-radius) * .7); transition: border-color .2s var(--sc-ease), background-color .2s var(--sc-ease), box-shadow .2s var(--sc-ease); }
.sc-opt:hover span { border-color: color-mix(in srgb, var(--sc-accent) 50%, transparent); }
.sc-opt input:checked + span { border-color: var(--sc-accent); box-shadow: inset 0 0 0 1px var(--sc-accent); background: color-mix(in srgb, var(--sc-accent) 7%, transparent); font-weight: 600; }
.sc-opt input:focus-visible + span { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.sc-opt.is-out span { color: var(--sc-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.sc-variants.is-err .sc-opt span { border-color: var(--sc-bad); }

.sc-cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px; margin-top: 28px; border: 0; border-radius: 999px; background: var(--sc-accent); color: var(--sc-on-accent); font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; transition: background-color .25s var(--sc-ease), transform .25s var(--sc-ease), box-shadow .25s var(--sc-ease); box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--sc-accent) 80%, transparent); }
.sc-cta:hover { background: var(--sc-accent-hover); transform: translateY(-1px); }
.sc-cta:active { transform: translateY(0); }
.sc-cta:disabled { opacity: .6; cursor: progress; transform: none; }
.sc-info > .sc-cta { width: 100%; }
@media (min-width: 600px) { .sc-info > .sc-cta { width: auto; min-width: 280px; } }
.sc-cta-note { margin: 10px 0 0; font-size: .875rem; color: var(--sc-muted); }
.sc-desc { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--sc-line); max-width: 68ch; line-height: 1.7; }
.sc-desc > :first-child { margin-top: 0; }
.sc-desc h2, .sc-desc h3, .sc-desc h4 { font-family: var(--sc-font-display); line-height: 1.2; margin: 1.6em 0 .5em; }
.sc-desc h2 { font-size: 1.375rem; } .sc-desc h3 { font-size: 1.2rem; } .sc-desc h4 { font-size: 1.05rem; }
.sc-desc ul, .sc-desc ol { padding-left: 1.3em; }
.sc-desc li { margin: .3em 0; }
.sc-desc blockquote { margin: 1.2em 0; padding: .2em 0 .2em 1em; border-left: 1px solid var(--sc-line); color: var(--sc-muted); font-style: italic; }
.sc-desc a { text-underline-offset: 3px; }
/* Metadatos, compartir y productos relacionados */
.sc-meta { margin: 26px 0 0; padding: 0; display: grid; gap: 6px; font-size: .9375rem; }
.sc-meta div { display: flex; gap: 8px; }
.sc-meta dt { color: var(--sc-muted); }
.sc-meta dt::after { content: ':'; }
.sc-meta dd { margin: 0; }
.sc-meta a { text-underline-offset: 3px; }
.sc-share { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 18px; }
.sc-share-title { margin: 0; font-size: .9375rem; color: var(--sc-muted); }
.sc-share ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.sc-share a, .sc-share button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--sc-line); border-radius: 50%; background: transparent; color: inherit; cursor: pointer; transition: border-color .2s var(--sc-ease), color .2s var(--sc-ease), background-color .2s var(--sc-ease); }
.sc-share a:hover, .sc-share button:hover { border-color: var(--sc-accent); color: var(--sc-accent); background: color-mix(in srgb, var(--sc-accent) 6%, transparent); }
.sc-share svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sc-share-status { flex-basis: 100%; margin: 0; min-height: 1.2em; font-size: .875rem; color: var(--sc-ok); }
.sc-related { margin-top: clamp(48px, 7vw, 88px); padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--sc-line); }
.sc-related-title { font-family: var(--sc-font-display); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); line-height: 1.15; margin: 0 0 clamp(20px, 3vw, 32px); }
.sc-404 { text-align: center; padding-block: clamp(60px, 10vw, 120px); }

/* Popup de datos */
.sc-modal { width: min(100% - 24px, 460px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: calc(var(--sc-radius) + 4px); background: var(--sc-card); color: var(--sc-ink); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .45); overflow: auto; }
.sc-modal[open] { animation: sc-in .45s var(--sc-ease); }
.sc-modal::backdrop { background: rgba(10, 14, 20, .5); backdrop-filter: blur(3px); }
@keyframes sc-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.sc-form { margin: 0; }
.sc-m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 0; }
.sc-m-head h2 { margin: 0; font-family: var(--sc-font-display); font-size: 1.35rem; line-height: 1.2; }
.sc-m-sum { margin: 6px 0 0; font-size: .9375rem; color: var(--sc-muted); }
.sc-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -10px 0 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.sc-x:hover { background: var(--sc-soft); }
.sc-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.sc-m-body { padding: 8px 22px 22px; }
.sc-m-sub { margin: 0 0 16px; font-size: .9375rem; color: var(--sc-muted); }
.sc-field { margin: 0 0 14px; }
.sc-field > label { display: block; margin: 0 0 6px; font-size: .9375rem; font-weight: 600; }
.sc-field input[type="text"], .sc-field input[type="email"], .sc-field input[type="tel"] { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid color-mix(in srgb, currentColor 26%, transparent); border-radius: calc(var(--sc-radius) * .7); background: transparent; color: inherit; font: inherit; font-size: 16px; transition: border-color .2s var(--sc-ease), box-shadow .2s var(--sc-ease); }
.sc-field input:focus { outline: none; border-color: var(--sc-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc-accent) 22%, transparent); }
.sc-field input[aria-invalid="true"] { border-color: var(--sc-bad); }
.sc-field .iti { display: block; width: 100%; }
.sc-field > .sc-check { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: .875rem; font-weight: 400; line-height: 1.5; cursor: pointer; }
.sc-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--sc-accent); cursor: pointer; }
.sc-check a { text-underline-offset: 2px; }
.sc-err { margin: 6px 0 0; font-size: .875rem; color: var(--sc-bad); }
.sc-status { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--sc-bad) 9%, transparent); color: var(--sc-bad); font-size: .9375rem; }
.sc-submit { width: 100%; margin-top: 6px; }
.sc-done { padding: 30px 22px 26px; text-align: center; outline: none; }
.sc-done h2 { margin: 14px 0 6px; font-family: var(--sc-font-display); font-size: 1.35rem; }
.sc-done p { margin: 0; color: var(--sc-muted); }
.sc-done .sc-cta { margin-top: 20px; }
.sc-check-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: color-mix(in srgb, var(--sc-ok) 12%, transparent); color: var(--sc-ok); }
.sc-check-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 520px) {
  .sc-modal { width: 100%; max-width: none; margin: auto 0 0; border-radius: calc(var(--sc-radius) + 4px) calc(var(--sc-radius) + 4px) 0 0; max-height: 92dvh; }
  @keyframes sc-in { from { transform: translateY(40px); } }
}
@media (prefers-reduced-motion: reduce) { .sc-card a:hover .sc-card-img img, .sc-cta:hover { transform: none; } }
