/* Materiales de Construcción Pedro Jesús — hoja de estilos principal
   Diseño y desarrollo: Tu Oficina Digital Online */
:root {
  --brick: #b5461f;
  --brick-dark: #983a19;
  --maroon: #7a2a24;
  --ink: #1f2328;
  --ink-soft: #4a5058;
  --muted: #6b7178;
  --line: #e6e1dc;
  --bg: #ffffff;
  --bg-alt: #faf6f2;
  --bg-dark: #1b1d21;
  --ok: #1e8e3e;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(31, 35, 40, .08);
  --shadow-lg: 0 18px 50px rgba(31, 35, 40, .16);
  --wrap: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.65;
  color: var(--ink); background: var(--bg);
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brick-dark); text-underline-offset: 3px; }
a:hover { color: var(--maroon); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 200; background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 8px; }
.skip-link:focus { top: 1rem; color: #fff; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--bg-dark); color: #e9e9ea; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark .eyebrow { color: #f08a5d; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brick); margin-bottom: .7rem; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }
.section-head { max-width: 760px; margin-bottom: 2.6rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .lead { margin-inline: auto; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; vertical-align: -.2em; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: .55rem; justify-content: center;
  padding: .85rem 1.4rem; border-radius: 999px; font-weight: 700; font-size: 1rem;
  text-decoration: none; border: 2px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--brick); color: #fff; }
.btn--primary:hover { background: var(--brick-dark); color: #fff; }
.btn--ghost { border-color: currentColor; color: #fff; background: rgba(255, 255, 255, .06); }
.btn--ghost:hover { background: #fff; color: var(--ink); }
.btn--outline { border-color: var(--brick); color: var(--brick-dark); background: transparent; }
.btn--outline:hover { background: var(--brick); color: #fff; }
.btn--wa { background: #25d366; color: #0b3d1e; }
.btn--wa:hover { background: #1ebe5a; color: #0b3d1e; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Barra superior */
.topbar { background: var(--maroon); color: #f7e7e2; font-size: .88rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: space-between; padding: .45rem 0; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }
.topbar__group { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; align-items: center; }
@media (max-width: 700px) { .topbar__hide-m { display: none; } .topbar .wrap { justify-content: center; } }
.open-status { display: inline-flex; align-items: center; gap: .4rem; }
.open-status::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #bbb; }
.open-status.is-open::before { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.open-status.is-closed::before { background: #f87171; }

/* Cabecera */
.header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 74px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand img { width: 62px; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text strong { font-size: 1.05rem; color: var(--maroon); }
.brand__text span { font-size: .78rem; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .3rem; }
.nav a { display: block; padding: .55rem .85rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; }
.nav a:hover { background: var(--bg-alt); color: var(--brick-dark); }
.nav a[aria-current="page"] { color: var(--brick-dark); box-shadow: inset 0 -3px 0 var(--brick); border-radius: 0; }
.nav .nav__shop { background: var(--brick); color: #fff; border-radius: 999px; padding-inline: 1.1rem; display: inline-flex; gap: .45rem; align-items: center; }
.nav .nav__shop:hover { background: var(--brick-dark); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; color: var(--ink); cursor: pointer; }
.nav-toggle .icon { width: 30px; height: 30px; }

@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: fixed; inset: 74px 0 auto 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); display: none; max-height: calc(100vh - 74px); overflow: auto; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; padding: .8rem 16px 1.2rem; gap: .1rem; }
  .nav a { padding: .9rem 1rem; }
  .nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--brick); }
  .nav .nav__shop { justify-content: center; margin-top: .5rem; }
  .brand__text span { display: none; }
}

/* Hero */
.hero { position: relative; color: #fff; min-height: min(86vh, 760px); display: grid; align-items: center; overflow: hidden; background: #222; }
.hero__media, .hero__media video, .hero__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(20, 16, 15, .86) 0%, rgba(20, 16, 15, .62) 48%, rgba(122, 42, 36, .35) 100%); }
.hero__content { position: relative; z-index: 1; padding: 90px 0; max-width: 760px; }
.hero h1 { color: #fff; }
.hero .lead { color: #f0e6e1; font-size: 1.25rem; }
.hero__badges { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.6rem 0 2rem; padding: 0; list-style: none; }
.hero__badges li { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); padding: .4rem .85rem; border-radius: 999px; font-size: .92rem; display: inline-flex; gap: .45rem; align-items: center; }
.video-toggle { position: absolute; z-index: 2; right: 16px; top: 16px; background: rgba(0, 0, 0, .5); color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; padding: .45rem .8rem; cursor: pointer; font: inherit; font-size: .85rem; display: inline-flex; gap: .4rem; align-items: center; }

/* Cabecera de páginas interiores */
.page-hero { position: relative; color: #fff; background: var(--maroon); overflow: hidden; }
.page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.page-hero .wrap { position: relative; padding: clamp(56px, 9vw, 110px) 0 clamp(44px, 6vw, 72px); }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero p { color: #f5e4de; max-width: 60ch; font-size: 1.15rem; margin: 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1rem; font-size: .9rem; }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; opacity: .7; }
.breadcrumb a { color: #fff; }

/* Cifras */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: -60px; position: relative; z-index: 5; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1.4rem 1.3rem; border-top: 4px solid var(--brick); }
.stat strong { display: block; font-size: 2rem; color: var(--maroon); line-height: 1.1; }
.stat span { color: var(--ink-soft); font-size: .96rem; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); margin-top: -40px; gap: .7rem; } .stat { padding: 1rem; } .stat strong { font-size: 1.35rem; } .stat span { font-size: .85rem; display: block; line-height: 1.35; } }

/* Rejillas y tarjetas */
.grid { display: grid; gap: 1.4rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split--rev > :first-child { order: 2; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } .split--rev > :first-child { order: 0; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card h3 { margin-top: .9rem; }
.card p { color: var(--ink-soft); margin: 0; }
.card__icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: #fbe9e2; color: var(--brick-dark); }
.card__icon .icon { width: 28px; height: 28px; }

.cat-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; text-decoration: none; color: inherit; }
.cat-card__img { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--maroon), var(--brick)); display: grid; place-items: center; color: #fff; overflow: hidden; }
.cat-card__img picture, .cat-block__media picture, .gallery picture { display: block; width: 100%; height: 100%; }
.cat-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.cat-card:hover .cat-card__img img { transform: scale(1.05); }
.cat-card__img .icon { width: 64px; height: 64px; stroke-width: 1.6; }
.cat-card__body { padding: 1.1rem 1.3rem 1.4rem; }
.cat-card__body h3 { margin: 0 0 .3rem; }
.cat-card__body p { font-size: .95rem; }
.cat-card__more { display: inline-flex; gap: .3rem; align-items: center; margin-top: .7rem; font-weight: 700; color: var(--brick-dark); }

.media-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); position: relative; }
.media-frame img, .media-frame video { width: 100%; height: auto; }
.checklist { list-style: none; padding: 0; margin: 1.2rem 0 1.8rem; display: grid; gap: .75rem; }
.checklist li { display: flex; gap: .7rem; align-items: flex-start; }
.checklist .icon { color: var(--brick); margin-top: .2em; }

/* Certificaciones */
.cert { display: flex; gap: 1rem; align-items: flex-start; }
.cert__seal { flex: none; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .95rem; color: #fff; background: radial-gradient(circle at 30% 30%, var(--brick), var(--maroon)); border: 3px solid #f3d3c6; }
.cert h3 { margin: 0 0 .3rem; font-size: 1.08rem; }
.cert p { margin: 0; font-size: .96rem; color: var(--ink-soft); }
.section--dark .cert p { color: #c9cacd; }
.section--dark .card { background: #24272c; border-color: #33373d; }

/* Galería */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; list-style: none; padding: 0; margin: 0; }
.gallery li:first-child { grid-column: span 2; grid-row: span 2; }
.gallery li:nth-child(n+6) { grid-column: span 2; }
.gallery li:nth-child(n+6) img { aspect-ratio: 16 / 9; }
.gallery button { all: unset; cursor: zoom-in; display: block; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; position: relative; }
.gallery button:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; transition: transform .4s ease; }
.gallery button:hover img { transform: scale(1.05); }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1200px); max-height: 92vh; }
.lightbox::backdrop { background: rgba(10, 10, 10, .88); }
.lightbox img { max-height: 82vh; width: auto; margin: auto; border-radius: 10px; }
.lightbox p { color: #fff; text-align: center; margin: .6rem 0 0; }
.lightbox__close, .lightbox__nav { position: fixed; background: rgba(255, 255, 255, .14); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav--prev { left: 12px; top: 50%; }
.lightbox__nav--next { right: 12px; top: 50%; }

/* Vídeo */
.video-wrap { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: #000; aspect-ratio: 16 / 9; }
.video-wrap video { width: 100%; height: 100%; object-fit: cover; }

/* Catálogo */
.catalog-tools { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.search { position: relative; flex: 1 1 320px; max-width: 520px; }
.search input { width: 100%; padding: .9rem 1rem .9rem 2.8rem; border-radius: 999px; border: 2px solid var(--line); font: inherit; background: #fff; }
.search input:focus { border-color: var(--brick); outline: none; }
.search .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 2.4rem; }
.chips a { display: inline-block; padding: .4rem .9rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .93rem; font-weight: 600; }
.chips a:hover { border-color: var(--brick); color: var(--brick-dark); }
.cat-block { display: grid; grid-template-columns: 340px 1fr; gap: 2rem; padding: 2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.6rem; scroll-margin-top: 100px; }
.cat-block__media { border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--maroon), var(--brick)); display: grid; place-items: center; color: #fff; }
.cat-block__media img { width: 100%; height: 100%; object-fit: cover; }
.cat-block__media .icon { width: 84px; height: 84px; stroke-width: 1.4; }
.cat-block h2 { font-size: 1.6rem; margin-bottom: .3rem; }
.cat-block h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brick); margin: 1.1rem 0 .5rem; }
.cat-block ul { columns: 2; column-gap: 2rem; margin: 0; padding-left: 1.1rem; }
.cat-block li { break-inside: avoid; margin-bottom: .25rem; color: var(--ink-soft); }
.cat-block li mark { background: #fde6d8; color: inherit; padding: 0 .1em; border-radius: 3px; }
.cat-block .btn-row { margin-top: 1.4rem; }
@media (max-width: 860px) { .cat-block { grid-template-columns: 1fr; padding: 1.3rem; } .cat-block ul { columns: 1; } }
.no-results { padding: 2rem; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); }

/* Banner tienda */
.shop-banner { background: linear-gradient(120deg, var(--maroon), var(--brick)); color: #fff; border-radius: calc(var(--radius) + 6px); padding: clamp(1.8rem, 4vw, 3rem); display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; }
.shop-banner h2 { color: #fff; margin-bottom: .3em; }
.shop-banner p { margin: 0; color: #fbe7df; }
.shop-banner .btn { background: #fff; color: var(--maroon); }
.shop-banner .btn:hover { background: var(--ink); color: #fff; }
@media (max-width: 720px) { .shop-banner { grid-template-columns: 1fr; } }

/* FAQ */
.faq { max-width: 860px; margin-inline: auto; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: .8rem; }
.faq summary { cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--brick); line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }

/* Contacto */
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.2rem; }
.info-list li { display: flex; gap: 1rem; align-items: flex-start; }
.info-list .card__icon { width: 46px; height: 46px; }
.info-list strong { display: block; }
.info-list a { color: var(--ink); }
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { text-align: left; padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.hours tr.is-today { color: var(--brick-dark); font-weight: 700; }
.form { display: grid; gap: 1rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form__row { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.field input, .field select, .field textarea { width: 100%; padding: .8rem .95rem; border: 2px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brick); outline: none; }
.field textarea { min-height: 140px; resize: vertical; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .93rem; color: var(--ink-soft); }
.check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--brick); }
.hp { position: absolute; left: -9999px; }
.form-status { padding: .9rem 1rem; border-radius: 10px; display: none; }
.form-status.is-ok { display: block; background: #e7f6ec; color: #145c2a; }
.form-status.is-error { display: block; background: #fdecea; color: #8a1c13; }
.map-consent { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: #ddd; box-shadow: var(--shadow); }
.map-consent > img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.35) brightness(.55); }
.map-consent__overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 1.2rem; color: #fff; }
.map-consent__overlay p { max-width: 42ch; margin: 0 auto 1rem; font-size: .95rem; }
.map-consent iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Newsletter */
.newsletter { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2rem; align-items: center; }
.newsletter form { display: grid; gap: .8rem; }
.newsletter .inline { display: flex; gap: .6rem; }
.newsletter .inline input { flex: 1; padding: .85rem 1rem; border-radius: 999px; border: 0; font: inherit; min-width: 0; }
.newsletter .check { color: #c9cacd; }
.newsletter .check a { color: #fff; }
@media (max-width: 820px) { .newsletter { grid-template-columns: 1fr; } .newsletter .inline { flex-direction: column; } }

/* Pie */
.footer { background: #141518; color: #b9bbbf; font-size: .96rem; }
.footer .wrap { padding: 64px 0 28px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }
.footer h2 { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer a { color: #e6e7e9; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__brand img { width: 84px; background: #fff; border-radius: 10px; padding: 6px; margin-bottom: 1rem; }
.footer__bottom { border-top: 1px solid #2a2c31; margin-top: 2.6rem; padding-top: 1.4rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 1.5rem; font-size: .88rem; }
.footer__bottom ul { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.credit a { color: #f0a47f; font-weight: 600; }

/* Elementos flotantes */
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 90; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.wa-float:hover { color: #fff; transform: scale(1.06); }
.wa-float svg { width: 32px; height: 32px; }
.to-top { position: fixed; right: 24px; bottom: 88px; z-index: 89; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; border: 0; cursor: pointer; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.is-visible { opacity: .85; pointer-events: auto; }

/* Banner de cookies */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 150; max-width: 760px; margin-inline: auto; background: #fff; color: var(--ink); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); padding: 1.3rem 1.4rem; border: 1px solid var(--line); }
.cookie-banner[hidden] { display: none; }
.cookie-banner h2 { font-size: 1.1rem; margin-bottom: .4rem; }
.cookie-banner p { font-size: .93rem; color: var(--ink-soft); margin-bottom: 1rem; }
.cookie-banner .btn { padding: .65rem 1.1rem; font-size: .93rem; }
.cookie-banner .btn--outline { color: var(--ink); border-color: var(--ink); }
.cookie-banner .btn--outline:hover { background: var(--ink); color: #fff; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* Texto legal */
.prose { max-width: 820px; }
.prose h2 { font-size: 1.4rem; margin-top: 2rem; }
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .6rem; text-align: left; vertical-align: top; }

/* Animación de aparición */
.reveal { transition: opacity .6s ease, transform .6s ease; }
.reveal.is-pending { opacity: 0; transform: translateY(18px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-pending { opacity: 1; transform: none; transition: none; }
  .btn, .card, .cat-card__img img, .gallery img { transition: none; }
}
@media print { .header, .topbar, .wa-float, .to-top, .cookie-banner, .hero__media { display: none !important; } }

/* Redes sociales */
.footer .social { display: flex; flex-wrap: wrap; gap: .6rem; }
.footer .social a { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border: 1px solid #33363c; border-radius: 999px; }
.footer .social a:hover { background: var(--brick); border-color: var(--brick); text-decoration: none; }
.topbar .icon { width: 1.05em; height: 1.05em; }
.footer ul + h2 { margin-top: 1.6rem; }

/* Sellos de validación W3C */
.w3c-badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.w3c-badges a { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border: 1px solid #3a3d44; border-radius: 6px; background: #1d1f23; color: #e6e7e9; font-size: .82rem; text-decoration: none; }
.w3c-badges a:hover { border-color: #f08a5d; color: #fff; text-decoration: none; }
.w3c-badges strong { color: #f08a5d; letter-spacing: .04em; }
.w3c-badges__ok { color: #4ade80; font-weight: 700; }
@media (max-width: 700px) { .footer .wrap { padding-bottom: 96px; } }

/* Cabecera: desplegable de categorías y buscador */
.nav .has-sub { position: relative; display: flex; align-items: center; }
.sub-toggle { background: none; border: 0; padding: .4rem .2rem; margin-left: -.5rem; cursor: pointer; color: var(--ink); display: inline-flex; border-radius: 6px; }
.sub-toggle .icon { width: 18px; height: 18px; transition: transform .2s; }
.sub-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.subnav { list-style: none; margin: 0; padding: .6rem; position: absolute; top: calc(100% + 6px); left: -12px; z-index: 120; min-width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); display: none; }
.nav .subnav { display: none; flex-direction: column; align-items: stretch; gap: 0; }
.nav .has-sub.is-open > .subnav { display: flex; }
@media (min-width: 1101px) and (hover: hover) { .nav .has-sub:hover > .subnav { display: flex; } }
.subnav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; font-weight: 500; border-radius: 8px; }
.subnav a .icon { color: var(--brick); width: 1.1em; height: 1.1em; }
.subnav a[aria-current="page"] { box-shadow: none; background: var(--bg-alt); }
.subnav__all { border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }
.subnav__all a { font-weight: 700; color: var(--brick-dark); justify-content: space-between; }
.hsearch { display: flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; background: #fff; padding-left: .8rem; }
.hsearch:focus-within { border-color: var(--brick); }
.hsearch input { border: 0; outline: none; font: inherit; font-size: .92rem; width: 150px; padding: .45rem 0; background: transparent; color: var(--ink); }
.hsearch button { background: none; border: 0; cursor: pointer; padding: .45rem .7rem; color: var(--ink-soft); display: inline-flex; }
.hsearch button:hover { color: var(--brick-dark); }
@media (max-width: 1100px) {
  .nav .has-sub { flex-wrap: wrap; }
  .nav .has-sub > a { flex: 1; }
  .sub-toggle { padding: .8rem 1rem; margin: 0; }
  .subnav { position: static; min-width: 0; width: 100%; box-shadow: none; border: 0; border-left: 3px solid var(--line); border-radius: 0; margin: 0 0 .4rem 1rem; padding: .2rem 0 .2rem .4rem; }
  .nav__search { order: -1; margin-bottom: .4rem; }
  .hsearch input { width: 100%; padding: .7rem 0; }
}

/* Portada: subtítulo del lema */
.hero__tagline { font-size: clamp(1.25rem, 2.4vw, 1.7rem); font-weight: 700; color: #f6b08e; margin: -.2em 0 .7em; letter-spacing: -.01em; }

/* Páginas de categoría */
.fam-list { list-style: none; padding: 0; margin: 0 0 .4rem; columns: 2; column-gap: 1.5rem; }
.fam-list li { break-inside: avoid; display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .45rem; color: var(--ink-soft); }
.fam-list .icon { color: var(--brick); margin-top: .25em; width: 1.05em; height: 1.05em; }
@media (max-width: 600px) { .fam-list { columns: 1; } }
.cat-block h2 a { color: inherit; text-decoration: none; }
.cat-block h2 a:hover { color: var(--brick-dark); text-decoration: underline; }
.media-frame > .cat-block__media { aspect-ratio: 4 / 3; border-radius: 0; }

/* Barra de contacto fija en móvil */
.action-bar { display: none; }
@media (max-width: 700px) {
  .action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); }
  .action-bar a { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem .2rem .6rem; font-size: .78rem; font-weight: 700; color: var(--ink); text-decoration: none; }
  .action-bar a:nth-child(2) { color: #0f7a41; }
  .action-bar a:nth-child(3) { background: var(--brick); color: #fff; }
  .action-bar svg { width: 22px; height: 22px; }
  .action-bar a:nth-child(2) svg { fill: currentColor; }
  .wa-float { display: none; }
  .to-top { bottom: 84px; right: 14px; }
  .cookie-banner { bottom: 76px; }
}

/* Cabecera compacta en escritorio */
.nav a, .nav .nav__shop { white-space: nowrap; }
@media (min-width: 1101px) {
  .nav ul { gap: .1rem; }
  .nav a { padding: .55rem .7rem; }
  .nav__search { margin: 0 .4rem; }
  .hsearch input { width: 130px; }
}
@media (min-width: 1101px) and (max-width: 1280px) { .brand__text span { display: none; } .hsearch input { width: 105px; } }
