@font-face {
  font-family: "DM Sans";
  src: url("../fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Serif Display";
  src: url("../fonts/dm-serif-display-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #087a57;
  --green-dark: #075a42;
  --mint: #5ec39b;
  --sage: #92cc8f;
  --pale-sage: #ddebdc;
  --cream: #f6f8f3;
  --white: #ffffff;
  --ink: #193629;
  --muted: #52685b;
  --line: #cad9cb;
  --shadow: 0 16px 45px rgb(24 73 50 / 12%);
  --radius: 1.25rem;
  --font-body: "DM Sans", Arial, sans-serif;
  --font-heading: "DM Serif Display", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid #c26321;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 1rem;
  transform: translateY(-150%);
  padding: .65rem .9rem;
  border-radius: 0 0 .5rem .5rem;
  color: var(--white);
  background: var(--green-dark);
}

.skip-link:focus { transform: translateY(0); }
.container { width: min(100% - 2rem, 72rem); margin-inline: auto; }

.site-header { background: var(--cream); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 5.4rem; gap: 1rem; }
.brand { display: flex; align-items: center; }
.brand img { width: auto; height: 4.5rem; }
.text-link { font-size: .91rem; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: .26em; }
.store-link { white-space: nowrap; }

/* Móvil: encabezado + hero ocupan la pantalla completa (5.4rem de encabezado + 3.5rem de padding). */
.hero { overflow: hidden; padding: 1.5rem 0 2rem; background: linear-gradient(145deg, var(--cream) 0%, #eef5e9 100%); }
.hero-inner { display: grid; grid-template-rows: auto 1fr; gap: 1.5rem; min-height: calc(100vh - 8.9rem); min-height: calc(100svh - 8.9rem); }
.hero-copy { position: relative; z-index: 1; max-width: 38rem; }
.eyebrow { margin: 0 0 .75rem; color: var(--green-dark); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; color: var(--green-dark); line-height: 1.08; }
h1, h2 { font-family: var(--font-heading); font-weight: 400; }
h1 { margin-bottom: 1rem; font-size: clamp(2.5rem, 10vw, 4.6rem); letter-spacing: -.035em; }
h2 { margin-bottom: .65rem; font-size: clamp(2rem, 7vw, 3.3rem); letter-spacing: -.025em; }
h3 { font-size: 1.18rem; }
.hero-text { max-width: 33rem; margin: 0 0 1.65rem; color: var(--muted); font-size: 1.08rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; gap: .5rem; padding: .72rem 1rem; border: 1px solid transparent; border-radius: .75rem; font: inherit; font-weight: 750; line-height: 1.25; text-align: center; text-decoration: none; transition: transform .2s ease, background-color .2s ease, border-color .2s ease; }
.button:hover { transform: translateY(-2px); }
button.button { cursor: pointer; }
.button-small { min-height: 2.5rem; padding: .45rem .85rem; font-size: .92rem; }
.button-light { color: var(--green-dark); background: var(--white); }
.button-light:hover { background: var(--pale-sage); }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.button-primary { color: var(--white); background: var(--green-dark); }
.button-primary:hover { background: #063d2d; }
.button-secondary { color: var(--green-dark); border-color: var(--green-dark); background: transparent; }
.button-secondary:hover { background: var(--pale-sage); }

.hero-art { position: relative; display: grid; place-items: center; min-height: 10rem; }
.hero-art img { position: relative; z-index: 1; width: auto; max-width: 72vw; height: clamp(9rem, 32vh, 17rem); height: clamp(9rem, 32svh, 17rem); filter: drop-shadow(0 18px 16px rgb(4 83 56 / 15%)); }
.hero-orb { position: absolute; border-radius: 50%; }
.hero-orb-one { width: clamp(10rem, 34svh, 17rem); aspect-ratio: 1; background: var(--sage); opacity: .3; transform: translate(-12%, -4%); }
.hero-orb-two { width: clamp(6rem, 20svh, 10rem); aspect-ratio: 1; background: var(--mint); opacity: .22; transform: translate(80%, 55%); }

.section { padding: 4.25rem 0; }
.catalogs { background: var(--white); }
.section-heading { display: grid; gap: .25rem; margin-bottom: 1.8rem; }
.section-heading > p { max-width: 27rem; margin: 0; color: var(--muted); }
.section-heading.centered { text-align: center; justify-items: center; }
.catalog-status { min-height: 1.6rem; margin-bottom: 1rem; color: var(--muted); }
.catalog-status:empty { display: none; }
.catalog-status.error { padding: 1rem; border-left: 4px solid #b54d2d; color: #752f1b; background: #fff4ef; }
.catalog-status.error a { font-weight: 700; }
.catalog-grid { display: grid; gap: 1.25rem; }
.catalog-card { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 8px 25px rgb(15 67 42 / 6%); }
.catalog-cover { aspect-ratio: 5 / 7; width: 100%; height: auto; object-fit: cover; background: var(--pale-sage); }
.catalog-card-content { display: flex; flex-direction: column; padding: 1.25rem; }
.catalog-card h3 { margin-bottom: .5rem; }
.catalog-card p { margin: 0 0 1rem; color: var(--muted); }
.catalog-meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; margin-top: auto; margin-bottom: 1.1rem; color: var(--muted); font-size: .86rem; }
.catalog-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.catalog-actions { display: grid; gap: .65rem; }
.catalog-cover-link { display: block; }
.catalog-actions .button { min-width: 0; padding-inline: .6rem; }
.featured-grid .catalog-card { border-color: #add5b8; box-shadow: var(--shadow); }
.previous-catalogs { margin-top: 3.25rem; }
.previous-catalogs h3 { margin-bottom: 1.25rem; font-family: var(--font-heading); font-size: 1.75rem; font-weight: 400; }
.noscript-message { padding: 1rem; border-radius: .75rem; background: var(--pale-sage); }

/* Franja de tienda: decoarmonia.cl es donde se cierran las compras. */
.store-band { padding: 3rem 0; color: #ecf6ed; background: var(--green-dark); }
.store-band-inner { display: grid; gap: 1.5rem; align-items: center; }
.store-band .eyebrow { color: var(--sage); }
.store-band h2 { margin-bottom: .5rem; color: var(--white); font-size: clamp(1.8rem, 6vw, 2.8rem); }
.store-band p { max-width: 36rem; margin: 0; color: #c7dbcb; }
.store-band .button { justify-self: start; }

.how-to { background: var(--cream); }
.steps { display: grid; gap: 1.1rem; max-width: 67rem; margin: 2rem auto 2.1rem; padding: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; padding: 1.4rem; border-radius: var(--radius); background: var(--white); box-shadow: 0 6px 20px rgb(15 67 42 / 6%); }
.steps h3 { margin: .65rem 0 .45rem; }
.steps p { margin: 0; color: var(--muted); }
.step-number { color: var(--green); font-size: .85rem; font-weight: 800; letter-spacing: .09em; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; }

.site-footer { padding: 3rem 0 1.2rem; color: #ecf6ed; background: #123a2b; }
.footer-grid { display: grid; gap: 2rem; }
.footer-logo { width: auto; height: 5rem; margin-bottom: .6rem; filter: brightness(0) invert(1); }
.site-footer p { margin: 0; color: #c7dbcb; }
.site-footer address, .site-footer nav { display: grid; align-content: start; gap: .35rem; font-style: normal; }
.site-footer strong { margin-bottom: .15rem; }
.site-footer a { color: #ddecde; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.site-footer .footer-store { display: inline-block; margin-top: .75rem; color: var(--white); font-weight: 750; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid rgb(220 237 222 / 25%); color: #c7dbcb; font-size: .88rem; }

/* Visor de catálogo: las páginas son imágenes, sin PDF descargable. */
.viewer-body { padding-bottom: 4.5rem; }
.viewer { background: var(--cream); }
.viewer-intro { padding: 1rem 0 1.5rem; }
.viewer-intro h1 { margin-bottom: .5rem; font-size: clamp(2rem, 8vw, 3.4rem); }
.viewer-intro p { max-width: 40rem; margin: 0 0 .5rem; color: var(--muted); }
.viewer-hint { font-size: .9rem; }
.viewer-share { padding: 0; border: 0; color: var(--green-dark); background: none; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.viewer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: .9rem; }
.viewer-modes { display: inline-flex; overflow: hidden; border: 1px solid var(--green-dark); border-radius: .75rem; }
.viewer-modes button { padding: .5rem 1.1rem; border: 0; color: var(--green-dark); background: transparent; font: inherit; font-weight: 750; cursor: pointer; }
.viewer-modes button[aria-pressed="true"] { color: var(--white); background: var(--green-dark); }

/* Libro (StPageFlip). Reglas de la librería copiadas aquí porque la CSP no permite su <style> inline. */
.stf__parent { position: relative; display: block; box-sizing: border-box; transform: translateZ(0); touch-action: pan-y; }
.stf__wrapper, .sft__wrapper { position: relative; width: 100%; box-sizing: border-box; }
.stf__parent canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.stf__block { position: absolute; width: 100%; height: 100%; box-sizing: border-box; perspective: 2000px; }
.stf__item { position: absolute; display: none; transform-style: preserve-3d; }
.stf__outerShadow, .stf__innerShadow, .stf__hardShadow, .stf__hardInnerShadow { position: absolute; top: 0; left: 0; }

.viewer-stage-wrap { display: grid; justify-items: center; gap: .75rem; padding-bottom: 2rem; }
.viewer-stage-wrap:fullscreen { align-content: center; padding: 1rem 0; background: var(--cream); }
.viewer-stage { position: relative; display: flex; justify-content: center; width: 100%; padding-inline: .5rem; }
.viewer-book { max-width: 100%; filter: drop-shadow(0 10px 22px rgb(15 67 42 / 18%)); }
.viewer-book-page { overflow: hidden; background: var(--white); }
.viewer-book-page img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.viewer-arrow { position: absolute; z-index: 5; top: 50%; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0 0 .2rem; transform: translateY(-50%); border: 0; border-radius: 50%; color: var(--green-dark); background: rgb(255 255 255 / 92%); box-shadow: 0 4px 14px rgb(15 67 42 / 20%); font-size: 2rem; line-height: 1; cursor: pointer; }
.viewer-arrow:disabled { opacity: .3; cursor: default; }
.viewer-arrow-prev { left: .25rem; }
.viewer-arrow-next { right: .25rem; }
.viewer-fullscreen { padding: 0; border: 0; color: var(--green-dark); background: none; font: inherit; font-size: .9rem; font-weight: 700; text-decoration: underline; cursor: pointer; }

.viewer-top { position: fixed; z-index: 11; right: 1rem; bottom: calc(5rem + env(safe-area-inset-bottom)); display: grid; place-items: center; width: 3rem; height: 3rem; border: 0; border-radius: 50%; color: var(--white); background: var(--green-dark); box-shadow: var(--shadow); font-size: 1.4rem; cursor: pointer; }
.viewer-index { width: min(100% - 2rem, 52rem); max-height: 85vh; padding: 1.25rem; border: 0; border-radius: var(--radius); color: var(--ink); background: var(--cream); }
.viewer-index::backdrop { background: rgb(18 58 43 / 60%); }
.viewer-index-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.viewer-index-head h2 { margin: 0; font-size: 1.6rem; }
.viewer-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .75rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.viewer-index-grid button { display: grid; gap: .3rem; width: 100%; padding: 0; border: 2px solid transparent; border-radius: .5rem; color: var(--ink); background: none; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.viewer-index-grid button:hover { border-color: var(--mint); }
.viewer-index-grid img { width: 100%; border-radius: .35rem; box-shadow: 0 3px 10px rgb(15 67 42 / 12%); }

.viewer-end { padding: 1rem 0 3rem; text-align: center; }
.viewer-end h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.viewer-end p { margin: 0 0 1.25rem; color: var(--muted); }
.viewer-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; }
.viewer-pages { display: grid; gap: .75rem; width: min(100%, 52rem); margin-inline: auto; padding-bottom: 3rem; }
.viewer-sheet { margin: 0; background: var(--white); box-shadow: 0 6px 24px rgb(15 67 42 / 10%); }
.viewer-sheet img { width: 100%; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.viewer-bar { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(246 248 243 / 95%); }
.viewer-counter { margin-right: auto; padding: .45rem .25rem; border: 0; color: var(--green-dark); background: none; font: inherit; font-size: .9rem; font-weight: 750; font-variant-numeric: tabular-nums; cursor: pointer; }
.viewer-bar .button { min-height: 2.75rem; padding: .55rem .9rem; }
.viewer-counter-label { display: none; }

@media (min-width: 42rem) {
  .container { width: min(100% - 3.5rem, 72rem); }
  .hero { padding: 4rem 0 5rem; }
  .hero-inner { grid-template-columns: 1.25fr .75fr; grid-template-rows: none; gap: 2rem; align-items: center; min-height: 0; }
  .hero-art { min-height: 20rem; }
  .hero-art img { width: min(28vw, 17rem); max-width: 100%; height: auto; }
  .hero-orb-one { width: 14rem; }
  .hero-orb-two { width: 8.5rem; }
  .section-heading { grid-template-columns: 1fr minmax(15rem, .75fr); align-items: end; }
  .section-heading.centered { display: block; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-grid .catalog-card { grid-column: span 2; grid-template-columns: minmax(13rem, 20rem) 1fr; }
  .featured-grid .catalog-card-content { justify-content: center; padding: 2rem; }
  .featured-grid .catalog-card h3 { font-family: var(--font-heading); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 400; }
  .featured-grid .catalog-meta { margin-top: .25rem; }
  .featured-grid .catalog-actions { max-width: 26rem; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .store-band-inner { grid-template-columns: 1fr auto; }
  .store-band .button { justify-self: end; }
  .viewer-pages { gap: 1.25rem; }
  .viewer-stage { padding-inline: 3.75rem; }
  .viewer-arrow-prev { left: .5rem; }
  .viewer-arrow-next { right: .5rem; }
  .viewer-bar { justify-content: center; }
  .viewer-counter { margin-right: 1.5rem; }
  .viewer-counter-label { display: inline; }
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
}

@media (min-width: 62rem) {
  .header-inner { min-height: 6rem; }
  .brand img { height: 5.25rem; }
  .catalog-grid { grid-template-columns: repeat(3, 1fr); }
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-grid .catalog-card { grid-column: auto / span 2; }
  .previous-catalogs .catalog-grid { grid-template-columns: repeat(3, 1fr); }
}

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