/* Vitrina Commerce · tienda pública
   Paleta: --brand y --accent se definen desde el panel. */
:root {
  --ink: #1b1f24;
  --muted: #5b6470;
  --paper: #ffffff;
  --mist: #eef1f5;
  --line: #dce1e8;
  --ok: #1e7b34;
  --radius-s: 4px;
  --radius-m: 8px;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --bs-body-font-family: var(--font-body);
  --bs-link-color-rgb: 29, 78, 137;
}
body { font-family: var(--font-body); color: var(--ink); background: var(--paper); font-size: 1rem; line-height: 1.55; }
h1, h2, h3, .page-title, .banner-title, .footer-name, .brand-word { font-family: var(--font-display); letter-spacing: -0.01em; }
a { color: var(--brand); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; }
.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: var(--ink); color: #fff; padding: .5rem 1rem; }
img { max-width: 100%; height: auto; }

/* Botones */
.btn-brand { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--ink); --bs-btn-disabled-bg: #8b94a0; --bs-btn-disabled-border-color: #8b94a0; font-weight: 600; border-radius: var(--radius-s); }
.btn { border-radius: var(--radius-s); }

/* Cabecera */
.utility-bar { background: var(--ink); color: #e9edf2; font-size: .875rem; padding: .4rem 0; text-align: center; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.header-row { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center; padding-top: .9rem; padding-bottom: .9rem; }
.brand { text-decoration: none; color: var(--ink); }
.brand-word { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.search { display: flex; max-width: 620px; width: 100%; justify-self: center; border: 2px solid var(--ink); border-radius: var(--radius-s); overflow: hidden; }
.search input { flex: 1; border: 0; padding: .6rem .9rem; font: inherit; min-width: 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid color-mix(in srgb, var(--brand) 45%, white); }
.search button { border: 0; background: var(--ink); color: #fff; padding: 0 1.1rem; font-weight: 600; }
.header-actions { display: flex; gap: 1.1rem; align-items: center; white-space: nowrap; }
.header-actions a { color: var(--ink); text-decoration: none; font-weight: 600; }
.cart-count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .8rem; margin-left: .25rem; }
.cat-nav { border-top: 1px solid var(--line); }
.cat-nav ul { list-style: none; margin: 0; padding: 0; gap: .25rem 1.5rem; flex-wrap: wrap; }
.cat-nav > .container > ul > li { position: relative; }
.cat-nav a { display: block; padding: .6rem 0; color: var(--ink); text-decoration: none; font-weight: 500; }
.cat-nav a:hover { color: var(--brand); }
.cat-nav .sale-link { color: var(--accent); font-weight: 700; }
.cat-nav .sub { display: none; position: absolute; top: 100%; left: -1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: .5rem 1rem; min-width: 220px; z-index: 30; }
.cat-nav .has-children:hover .sub, .cat-nav .has-children:focus-within .sub { display: block; }
.cat-nav .sub a { padding: .35rem 0; font-weight: 400; }
.cat-toggle { background: none; border: 0; padding: .6rem 0; font-weight: 600; }
@media (max-width: 991.98px) {
  .header-row { grid-template-columns: 1fr auto; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .cat-nav ul.collapse.show { display: block; padding-bottom: .5rem; }
  .cat-nav .sub { display: block; position: static; border: 0; padding: 0 0 0 1rem; }
}

/* Banner principal: el elemento protagonista */
.hero { padding: 1.5rem 0 0; }
.banner { position: relative; display: block; border-radius: var(--radius-m); overflow: hidden; background: var(--brand); color: #fff; text-decoration: none; }
.banner:hover, .banner:focus { color: #fff; }
.banner.no-image { min-height: 300px; display: flex; align-items: flex-end; }
/* Imagen completa: sin alto fijo ni object-fit, el banner toma la proporción real de la imagen */
.banner.has-image { background: var(--mist); }
.banner-media, .banner-media img { display: block; width: 100%; height: auto; }
.banner.with-copy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,14,20,.66) 0%, rgba(10,14,20,.2) 55%, rgba(10,14,20,0) 100%); pointer-events: none; }
.banner-copy { position: relative; z-index: 2; padding: clamp(1.25rem, 4vw, 3.5rem); max-width: 720px; }
.banner.with-copy .banner-copy { position: absolute; left: 0; bottom: 0; }
.banner-title { font-size: clamp(1.6rem, 4.6vw, 4.2rem); font-weight: 800; line-height: .98; margin: 0 0 .75rem; color: #fff; }
.banner-text { font-size: clamp(.95rem, 1.4vw, 1.15rem); max-width: 52ch; margin-bottom: 1.25rem; opacity: .95; }
.banner-btn { pointer-events: none; }
.banner.is-link:hover .banner-btn { background: var(--ink); border-color: var(--ink); color: #fff; }
.banner.is-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 3px; }
.banner.no-image .banner-title { font-size: clamp(2.4rem, 7vw, 5.6rem); }
/* Franjas muy apaisadas y pantallas chicas: el texto va debajo de la imagen para no taparla */
.banner.copy-below::after { display: none; }
.banner.copy-below .banner-copy { position: relative; background: var(--brand); max-width: none; }
@media (max-width: 767.98px) {
  .banner.with-copy::after { display: none; }
  .banner.with-copy .banner-copy { position: relative; background: var(--brand); max-width: none; padding: 1.1rem 1.25rem 1.3rem; }
  .banner.with-copy .banner-title { font-size: clamp(1.5rem, 7vw, 2.2rem); }
  .banner-text { margin-bottom: .9rem; }
}
.carousel-control-prev, .carousel-control-next { width: 3.5rem; z-index: 3; }

/* Categorías destacadas */
.cat-strip { padding: 1.5rem 0 .5rem; }
.cat-tiles { list-style: none; padding: 0; margin: 0; display: flex; gap: .75rem; overflow-x: auto; scrollbar-width: thin; }
.cat-tiles a { display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem .55rem .55rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; background: var(--paper); }
.cat-tiles a:hover { border-color: var(--ink); }
.cat-tiles img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.cat-tiles a:not(:has(img)) { padding-left: 1rem; }

/* Vitrinas de productos */
.shelf { padding: 2.5rem 0 1rem; }
.shelf-head, .offer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.25rem; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; }
.shelf-head h2, .offer-head h2 { font-size: 1.6rem; font-weight: 700; margin: 0; }
.shelf-head a, .offer-head a { font-weight: 600; text-decoration: none; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.75rem 1.25rem; }
.product-grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 991.98px) { .product-grid, .product-grid.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem .9rem; } }
.product-card { display: flex; flex-direction: column; }
.product-media { position: relative; display: block; aspect-ratio: 1; background: var(--mist); border-radius: var(--radius-m); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.tag { position: absolute; top: .6rem; left: .6rem; padding: .15rem .5rem; border-radius: var(--radius-s); font-size: .8rem; font-weight: 700; }
.tag-sale { background: var(--accent); color: #fff; }
.tag-out { background: var(--ink); color: #fff; left: auto; right: .6rem; }
.product-body { padding-top: .7rem; }
.product-brand { font-size: .82rem; color: var(--muted); margin: 0 0 .15rem; text-decoration: none; display: inline-block; }
.product-name { font-family: var(--font-body); font-size: 1rem; font-weight: 600; line-height: 1.35; margin: 0 0 .35rem; }
.product-name a { color: var(--ink); text-decoration: none; }
.product-name a:hover { text-decoration: underline; }
.product-price { margin: 0; display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; }
.product-price strong { font-size: 1.12rem; }
.product-price del { color: var(--muted); font-size: .9rem; }
.product-price .from { font-size: .8rem; color: var(--muted); width: 100%; }
.product-rating { font-size: .85rem; color: var(--muted); margin: .3rem 0 0; }
.stars { --r: 0; display: inline-block; font-size: 1rem; line-height: 1; letter-spacing: 1px; }
.stars::before { content: "★★★★★"; background: linear-gradient(90deg, #e0a100 calc(var(--r) / 5 * 100%), #cfd5dd calc(var(--r) / 5 * 100%)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.offer-band { background: var(--mist); padding: 2.5rem 0; margin-top: 2rem; }
.offer-band .offer-head { border-color: var(--accent); }
.offer-band .offer-head h2 { color: var(--accent); }

.brands { padding: 2.5rem 0 1rem; }
.brands h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.brand-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.brand-list a { display: grid; place-items: center; min-width: 130px; height: 64px; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--ink); text-decoration: none; font-weight: 600; }
.brand-list img { max-height: 40px; width: auto; }

.assurances { padding: 2.5rem 0; border-top: 1px solid var(--line); margin-top: 2rem; }
.assure-title { font-weight: 700; margin-bottom: .25rem; }
.assurances p { margin-bottom: 0; color: var(--muted); }
.assurances .assure-title { color: var(--ink); }
.pay-methods { margin-top: 1.75rem; }
.pay-methods ul { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.pay-methods li { border: 1px solid var(--line); border-radius: var(--radius-s); padding: .25rem .6rem; font-size: .9rem; }

.newsletter { background: var(--ink); color: #fff; padding: 2.5rem 0; }
.newsletter-form { display: grid; grid-template-columns: 1fr minmax(280px, 460px); gap: 1.5rem; align-items: center; }
.newsletter h2 { font-size: 1.6rem; margin: 0 0 .25rem; }
.newsletter p { margin: 0; color: #c7ced8; }
.newsletter-input { display: flex; gap: .5rem; }
.newsletter-input input { flex: 1; min-width: 0; border: 0; border-radius: var(--radius-s); padding: .65rem .9rem; font: inherit; }
.newsletter .form-result { grid-column: 1 / -1; min-height: 1.2em; }
@media (max-width: 767.98px) { .newsletter-form { grid-template-columns: 1fr; } }

/* Catálogo */
.catalog-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.catalog-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800; margin: 0; }
.sort-form { display: flex; align-items: center; }
.sort-form select { width: auto; }
.catalog-intro { max-width: 75ch; color: var(--muted); margin-bottom: 1.5rem; }
.filters fieldset { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1rem; }
.filters legend { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; float: none; }
.filter-cats, .filter-cats ul { list-style: none; padding: 0; margin: 0; }
.filter-cats ul { padding-left: 1rem; }
.filter-cats a { display: block; padding: .2rem 0; color: var(--ink); text-decoration: none; }
.filter-cats a.active { color: var(--brand); font-weight: 700; }
.empty-state { border: 1px dashed var(--line); border-radius: var(--radius-m); padding: 2.5rem; text-align: center; }
.empty-state h2 { font-size: 1.4rem; }
.small-empty { padding: 1.5rem; }
.pagination { --bs-pagination-color: var(--ink); --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink); }

/* Ficha de producto */
.gallery-main { background: var(--mist); border-radius: var(--radius-m); overflow: hidden; aspect-ratio: 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.gallery-thumbs button { border: 2px solid transparent; padding: 0; border-radius: var(--radius-s); overflow: hidden; background: var(--mist); }
.gallery-thumbs button.active { border-color: var(--ink); }
.gallery-thumbs img { width: 72px; height: 72px; object-fit: cover; display: block; }
.buy-box { position: sticky; top: 140px; }
.product-title { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.08; margin: .2rem 0 .4rem; }
.sku { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.buy-price { display: flex; gap: .75rem; align-items: baseline; margin: 1rem 0 .25rem; }
.buy-price strong { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; }
.buy-price del { color: var(--muted); font-size: 1.1rem; }
.tax-note { font-size: .85rem; color: var(--muted); }
.lead-text { font-size: 1.05rem; max-width: 60ch; }
.variant-picker { margin: 1rem 0; }
.variant-picker legend { font-size: .95rem; font-weight: 700; }
.variant-picker .btn { margin: 0 .35rem .45rem 0; }
.stock-line { font-weight: 600; color: var(--ok); min-height: 1.5em; margin: .5rem 0; }
.add-row { display: flex; gap: .75rem; }
.add-row .qty { width: 90px; text-align: center; }
.form-result { font-size: .95rem; margin: .5rem 0 0; min-height: 1.4em; }
.form-result.is-ok { color: var(--ok); }
.form-result.is-error { color: #b3261e; }
.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; font-size: .95rem; }
.spec-list dt { color: var(--muted); font-weight: 400; }
.spec-list dd { margin: 0; }
.product-description, .reviews { max-width: 78ch; margin-top: 3rem; }
.product-description h2, .reviews h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.prose { line-height: 1.7; }
.prose img { border-radius: var(--radius-m); }
.prose h2, .prose h3 { margin-top: 1.5em; }
.prose h3 { font-size: 1.15rem; }
.prose ul { padding-left: 1.2rem; }
.prose table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.prose th { width: 42%; color: var(--muted); font-weight: 500; }
.prose tr:nth-child(odd) td, .prose tr:nth-child(odd) th { background: var(--mist); }
@media (max-width: 575.98px) { .prose th { width: 46%; } .prose th, .prose td { padding: .45rem .5rem; } }
.review { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.review-meta { color: var(--muted); font-size: .85rem; margin: 0; }
.rating-input { display: inline-flex; flex-direction: row-reverse; gap: .2rem; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input label { cursor: pointer; font-size: 1.8rem; line-height: 1; color: #cfd5dd; }
.rating-input label::before { content: "★"; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #e0a100; }
.rating-input input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); }

/* Carrito y checkout */
.page-title { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; margin-bottom: 1.25rem; }
.cart-item { display: flex; gap: .75rem; align-items: center; }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-s); background: var(--mist); }
.cart-item a { color: var(--ink); font-weight: 600; text-decoration: none; }
.summary { background: var(--mist); border-radius: var(--radius-m); padding: 1.5rem; top: 140px; }
.summary h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; margin: 1rem 0; }
.totals dt { font-weight: 400; }
.totals dd { margin: 0; text-align: right; }
.totals .total { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .3rem; }
.totals [hidden] { display: none; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; background: var(--paper); border-radius: var(--radius-s); padding: .4rem .75rem; }
.summary-items { list-style: none; padding: 0; margin: 0 0 .5rem; max-height: 260px; overflow: auto; }
.summary-items li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.step { border-bottom: 1px solid var(--line); padding: 1.5rem 0; }
.step:first-child { padding-top: 0; }
.step h2 { font-size: 1.3rem; display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.step-n { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--ink); color: #fff; font-size: .95rem; font-family: var(--font-body); }
.option-list { display: grid; gap: .5rem; }
.option { display: flex; align-items: flex-start; gap: .7rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-m); cursor: pointer; }
.option:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.option input { margin-top: .3rem; }
.option .opt-main { flex: 1; }
.option .opt-price { font-weight: 700; white-space: nowrap; }
.option .opt-meta { display: block; font-size: .85rem; color: var(--muted); }
.checkout-login { background: var(--mist); padding: .7rem 1rem; border-radius: var(--radius-s); }
.is-dim { opacity: .55; }

/* Pedido y cuenta */
.order-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1.5rem; }
.order-badges .badge { font-size: .85rem; }
.transfer-data { background: var(--paper); padding: .75rem 1rem; border-radius: var(--radius-s); white-space: pre-wrap; font-size: .9rem; margin: .5rem 0; }
.timeline { padding-left: 1.2rem; }
.timeline li { margin-bottom: .35rem; }
.account-nav ul { list-style: none; padding: 0; margin: 0 0 1rem; border-left: 2px solid var(--line); }
.account-nav a { display: block; padding: .45rem 1rem; color: var(--ink); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.account-nav a[aria-current="page"] { border-left-color: var(--brand); color: var(--brand); font-weight: 700; }
.address-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1rem; height: 100%; }
.auth-box { max-width: 460px; }
.narrow { max-width: 820px; }
.error-code { font-family: var(--font-display); font-size: 5rem; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; }

/* Pie */
.site-footer { background: var(--mist); padding: 3rem 0 1.5rem; margin-top: 0; font-size: .95rem; }
.footer-name { font-size: 1.4rem; font-weight: 800; margin-bottom: .5rem; }
.footer-title { font-weight: 700; margin-bottom: .5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .3rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--line); margin: 2rem 0 0; padding-top: 1rem; color: var(--muted); font-size: .85rem; }

/* Páginas de error */
.error-page { text-align: center; }
.error-page .lead-text { margin: 0 auto 1.5rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.5rem; }
.error-search { margin: 0 auto 1.25rem; max-width: 520px; }
.error-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.error-links a { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.error-links a:hover { border-color: var(--ink); }

/* Aviso de cookies */
.consent { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1080; max-width: 560px; margin-left: auto; background: var(--ink); color: #fff; border-radius: var(--radius-m); padding: 1rem 1.1rem; display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: .92rem; flex: 1 1 260px; }
.consent a { color: #fff; text-decoration: underline; }
.consent-actions { display: flex; gap: .5rem; }
.link-button { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; }

/* Mantención */
body.maintenance { display: grid; place-items: center; min-height: 100vh; background: var(--mist); text-align: center; padding: 2rem; font-family: system-ui, sans-serif; }
body.maintenance h1 { font-size: 2.4rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
