@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

/* ===================== Theme palettes (from templates.ts) ===================== */
:root {
  --primary: #20352b;
  --primary-dark: #13251d;
  --primary-light: #e1ebe2;
  --accent: #c46e3d;
  --accent-light: #f8dfc8;
  --bg: #fbfaf6;
  --bg-alt: #f1f0e9;
  --surface: #fffefa;
  --soft: #edf0e9;
  --border: #d8ddd1;
  --ink: #172019;
  --ink-soft: #59655b;
  --ink-faint: #879087;
  --on-primary: #fffdf7;
  --font-head: Georgia, 'Times New Roman', serif;
  --font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 25px;
  --radius-pill: 999px;
  --hero-gradient: linear-gradient(130deg, #13251d, #375b46 58%, #b8683c);
  --hero-overlay: rgba(19, 37, 29, .2);
  --hero-text: #fffdf7;
  --shadow-sm: 0 3px 10px rgba(23, 32, 25, .06);
  --shadow-md: 0 12px 30px rgba(23, 32, 25, .09);
  --shadow-lg: 0 20px 50px rgba(23, 32, 25, .16);
}
html[data-theme="hearth"] {
  --primary: #20352b;
  --primary-dark: #13251d;
  --primary-light: #e1ebe2;
  --accent: #c46e3d;
  --accent-light: #f8dfc8;
  --bg: #fbfaf6;
  --bg-alt: #f1f0e9;
  --surface: #fffefa;
  --soft: #edf0e9;
  --border: #d8ddd1;
  --ink: #172019;
  --ink-soft: #59655b;
  --ink-faint: #879087;
  --on-primary: #fffdf7;
  --font-head: Georgia, 'Times New Roman', serif;
  --font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 25px;
  --radius-pill: 999px;
  --hero-gradient: linear-gradient(130deg, #13251d, #375b46 58%, #b8683c);
  --hero-overlay: rgba(19, 37, 29, .2);
  --hero-text: #fffdf7;
  --shadow-sm: 0 3px 10px rgba(23, 32, 25, .06);
  --shadow-md: 0 12px 30px rgba(23, 32, 25, .09);
  --shadow-lg: 0 20px 50px rgba(23, 32, 25, .16);
}
html[data-theme="citrus"] {
  --primary: #e34f2f;
  --primary-dark: #a73320;
  --primary-light: #ffe5d7;
  --accent: #d99510;
  --accent-light: #fff2bd;
  --bg: #fffaf1;
  --bg-alt: #fff1da;
  --surface: #ffffff;
  --soft: #fff0df;
  --border: #ead6bf;
  --ink: #2d211b;
  --ink-soft: #715b4b;
  --ink-faint: #a68d79;
  --on-primary: #fffaf1;
  --font-head: 'Trebuchet MS', Arial, sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --hero-gradient: linear-gradient(120deg, #8f271c, #ec5833 55%, #f4b738);
  --hero-overlay: rgba(93, 28, 18, .14);
  --hero-text: #fffaf1;
  --shadow-sm: 0 3px 0 rgba(45, 33, 27, .06);
  --shadow-md: 0 12px 0 rgba(45, 33, 27, .08);
  --shadow-lg: 0 18px 40px rgba(45, 33, 27, .15);
}
html[data-theme="midnight"] {
  --primary: #d38a4d;
  --primary-dark: #f0b878;
  --primary-light: #303849;
  --accent: #76b5a6;
  --accent-light: #d7eee7;
  --bg: #141b27;
  --bg-alt: #1b2432;
  --surface: #202b3b;
  --soft: #293547;
  --border: #3c4a5c;
  --ink: #f4efe7;
  --ink-soft: #bcc5ce;
  --ink-faint: #8996a3;
  --on-primary: #171d28;
  --font-head: Georgia, 'Times New Roman', serif;
  --font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --radius: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --hero-gradient: linear-gradient(130deg, #0c111a, #1c3445 55%, #59402f);
  --hero-overlay: rgba(9, 13, 20, .1);
  --hero-text: #f7f0e6;
  --shadow-sm: 0 3px 12px rgba(0, 0, 0, .15);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .2);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .3);
}

/* Template-specific component tweaks (from templates.ts css) */
html[data-theme="hearth"] .hero { border-radius: 0 0 36px 36px; }
html[data-theme="hearth"] .card-image { filter: saturate(.86); }
html[data-theme="citrus"] .hero { padding-bottom: 120px; }
html[data-theme="citrus"] .card { border-width: 2px; box-shadow: none; }
html[data-theme="citrus"] .btn { border-radius: 8px; }
html[data-theme="midnight"] .site-header { background: color-mix(in srgb, #141b27 92%, transparent); }
html[data-theme="midnight"] .card { box-shadow: none; }
html[data-theme="midnight"] .btn-primary { color: #171d28; }

/* ===================== Header & nav ===================== */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 10px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-family: var(--font-head); font-size: 20px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--radius); text-decoration: none; color: var(--ink-soft); font-size: 14px; font-weight: 650; }
.nav-link:hover, .nav-link[aria-current="page"] { background: var(--primary-light); color: var(--primary-dark); }
.nav-toggle { display: none; border: 1px solid var(--border); background: var(--surface); color: var(--ink); min-width: 44px; min-height: 44px; border-radius: var(--radius); cursor: pointer; place-items: center; }
.nav-toggle:hover { color: var(--primary-dark); }
.nav-toggle svg { width: 22px; height: 22px; }

/* ===================== Buttons & tags ===================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-pill); font: inherit; font-size: 14px; font-weight: 800; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s, border-color .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-light { background: var(--surface); color: var(--primary-dark); }
.btn-light:hover { transform: translateY(-1px); }
.btn-outline { border-color: var(--border); background: transparent; color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); background: var(--primary-light); }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.tag, .badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--soft); color: var(--primary-dark); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.price { font-weight: 850; color: var(--primary-dark); font-size: 15px; }

/* ===================== Hero ===================== */
.hero { position: relative; overflow: hidden; background: var(--hero-gradient); color: var(--hero-text); padding: clamp(72px, 12vw, 148px) 0; }
.hero:after { content: ""; position: absolute; inset: 0; background: var(--hero-overlay); pointer-events: none; }
.hero-content { position: relative; z-index: 1; max-width: 720px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; font-weight: 800; color: var(--accent); margin: 0 0 14px; }
.hero .eyebrow { color: var(--accent-light); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.08; letter-spacing: -.045em; margin: 0 0 18px; }
h1 { font-size: clamp(42px, 8vw, 84px); max-width: 850px; }
h2 { font-size: clamp(32px, 5vw, 58px); }
h3 { font-size: clamp(22px, 3vw, 32px); }
p { margin: 0 0 16px; }
.lede { font-size: clamp(17px, 2vw, 21px); color: var(--ink-soft); max-width: 670px; }
.hero .lede { color: color-mix(in srgb, var(--hero-text) 82%, transparent); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ===================== Sections ===================== */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-head p { max-width: 560px; color: var(--ink-soft); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 24px; }
.card h3 { font-size: 27px; }
.card p { color: var(--ink-soft); }
.card-image, .media-placeholder { display: block; width: 100%; aspect-ratio: 1.35; object-fit: cover; background: linear-gradient(135deg, var(--primary-light), var(--accent-light)); color: var(--primary-dark); }
.media-placeholder { display: grid; place-items: center; font-family: var(--font-head); font-size: 44px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 7vw, 96px); align-items: center; }
.feature-list { display: grid; gap: 14px; padding: 0; margin: 26px 0 0; list-style: none; }
.feature-list li { display: flex; gap: 12px; align-items: start; }
.feature-list .icon { flex: none; color: var(--primary); margin-top: 4px; }
.icon { flex: none; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); display: block; transition: transform .3s; }
.gallery-grid img:hover { transform: scale(1.03); }
figure { margin: 0; }
figure img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); display: block; }
figcaption { font-size: 13px; color: var(--ink-soft); padding: 10px 4px 0; line-height: 1.4; }
.quote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.quote { padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.quote p { font-family: var(--font-head); font-size: 22px; line-height: 1.25; }
.stars { color: var(--accent); letter-spacing: 2px; }
.faq-list { display: grid; gap: 10px; max-width: 820px; }
.faq-list details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 17px 20px; }
.faq-list summary { cursor: pointer; font-weight: 800; }
.faq-list summary::marker { color: var(--accent); }
.rich { color: var(--ink-soft); }
.rich h2, .rich h3, .rich h4 { color: var(--ink); margin-top: 28px; }
.rich a { color: var(--primary-dark); text-decoration-thickness: 2px; }
.rich img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); margin: 20px 0; }
.rich ul, .rich ol { padding-left: 24px; }
.rich blockquote { border-left: 3px solid var(--accent); padding-left: 18px; font-family: var(--font-head); font-size: 22px; color: var(--ink); }

/* ===================== Forms ===================== */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 38px); box-shadow: var(--shadow-md); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-field { display: grid; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.form-label { font-weight: 750; font-size: 13px; }
.form-input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--ink); padding: 12px 13px; font: inherit; min-height: 46px; }
.form-input:focus-visible, .btn:focus-visible, .nav-link:focus-visible, .nav-toggle:focus-visible, summary:focus-visible, a:focus-visible, .theme-btn:focus-visible, .theme-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.check-label { display: flex; gap: 10px; align-items: start; font-size: 14px; color: var(--ink-soft); }
.check-label input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.notice { padding: 14px 17px; border-radius: var(--radius); background: var(--accent-light); color: var(--ink); margin-bottom: 20px; }
.success-box { padding: 26px; border-radius: var(--radius-lg); background: var(--accent-light); border: 1px solid var(--border); text-align: center; }
.success-box h3 { font-size: 26px; }
.success-box p { color: var(--ink-soft); }

/* ===================== Footer ===================== */
.site-footer { padding: 52px 0 26px; border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 34px; }
.footer-col { display: grid; align-content: start; gap: 8px; }
.footer-col a { color: var(--ink-soft); text-decoration: none; }
.footer-col a:hover { color: var(--primary); }
.footer-col .brand { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--border); margin-top: 36px; padding-top: 18px; color: var(--ink-faint); font-size: 13px; }
.powered-by a { color: inherit; text-decoration: none; }
.powered-by a:hover { text-decoration: underline; opacity: 1; }
.social-row { display: flex; gap: 14px; margin-top: 6px; }
.social-row a { font-weight: 700; font-size: 13px; }

/* ===================== WhatsApp float ===================== */
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 10; background: #1f8b58; color: white; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; box-shadow: var(--shadow-lg); text-decoration: none; font-weight: 900; }
.wa-float:hover { background: #176b45; text-decoration: none; }

/* ===================== Theme switcher ===================== */
.theme-btn {
  position: fixed; right: 18px; bottom: 82px; z-index: 60;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-lg); transition: transform .15s, color .15s;
}
.theme-btn:hover { color: var(--primary-dark); transform: translateY(-2px); }
.theme-btn svg { width: 24px; height: 24px; }
.theme-panel {
  position: fixed; right: 18px; bottom: 146px; z-index: 70;
  width: 300px; max-width: calc(100vw - 28px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 18px; display: none; text-align: left;
}
.theme-panel.open { display: block; }
.theme-panel h3 { font-size: 20px; margin: 0 0 4px; }
.theme-panel .theme-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }
.theme-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.theme-card:hover { border-color: var(--primary); }
.theme-card.active { border-color: var(--primary); background: var(--primary-light); }
.theme-swatches { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.theme-swatches .sw { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }
.theme-card .t-name { font-weight: 800; font-size: 14px; display: block; }
.theme-card .t-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.35; display: block; }
.theme-note { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 11px; color: var(--ink-faint); line-height: 1.4; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.empty { padding: 30px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--ink-soft); text-align: center; }

/* ===================== Responsive ===================== */
@media (max-width: 780px) {
  .container { width: min(100% - 28px, 620px); }
  .nav-toggle { display: grid; place-items: center; }
  .nav { display: none; position: absolute; left: 14px; right: 14px; top: 70px; flex-direction: column; align-items: stretch; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
  .nav.open { display: flex; }
  .nav-link { justify-content: center; }
  .card-grid, .quote-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .section-head { display: block; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-col:first-child { grid-column: 1 / -1; }
  .footer-bottom { display: block; }
  .footer-bottom span { display: block; margin-top: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
}
@media (max-width: 400px) {
  .theme-panel { right: 14px; bottom: 140px; }
  .theme-btn { right: 14px; bottom: 78px; }
  .gallery-grid { grid-template-columns: 1fr; }
  h1 { font-size: clamp(36px, 12vw, 48px); }
}