/*
Theme Name: IG Publishers
Theme URI: https://www.informationgiants.co.za/
Author: Information Giants (Pty) Ltd
Description: Custom theme for Information Giants Publishers. Book publishing, editing and communications, with a WooCommerce bookstore, POPIA-aware cookie consent, legal pages and a built-in help chatbot.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.8
WC requires at least: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ig-publishers
*/

/* ---------- Tokens ---------- */
:root {
  --black: #111111;
  --black-2: #2A2A2A;
  --red: #C8102E;
  --red-2: #A50D26;
  --red-bright: #F0324B;
  --green: #0B7A3E;
  --green-2: #096633;
  --green-bright: #3FBF73;

  --bg: #F5F5F3;
  --surface: #FFFFFF;
  --text: #141414;
  --muted: #5C5C5C;
  --line: #DADAD6;
  --chip: #EBEBE8;
  --link: #0B7A3E;
  --cover-bg: #EDEDEA;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .4);

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --wrap: 1200px;
  --book: 4px 14px 14px 4px;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E0E; --surface: #1A1A1A; --text: #EDEDED; --muted: #A8A8A8;
    --line: #333333; --chip: #262626; --link: #3FBF73; --cover-bg: #222222;
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E0E; --surface: #1A1A1A; --text: #EDEDED; --muted: #A8A8A8;
  --line: #333333; --chip: #262626; --link: #3FBF73; --cover-bg: #222222;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 90px); -webkit-text-size-adjust: 100%; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -.02em; font-weight: 700; margin: 0 0 .5em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.screen-reader-text, .sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 200; background: var(--red); color: #FFFFFF; padding: .6rem 1rem; font-family: var(--font-display); font-weight: 600; }
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + .5rem); }

/* ---------- Buttons (book-shaped: square spine, rounded pages) ---------- */
.btn, .button, button.button, input[type="submit"], .wp-element-button,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.2;
  padding: .85em 1.35em; border: 2px solid transparent; border-radius: var(--book); white-space: nowrap;
  background: var(--green); color: #fff; text-decoration: none; cursor: pointer;
  box-shadow: inset 5px 0 0 rgba(0, 0, 0, .18);
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover, .button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover { transform: translateY(-2px); background: var(--green-2); color: #fff; text-decoration: none; }
.btn--primary, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce #place_order, .single_add_to_cart_button {
  background: var(--red) !important; color: #FFFFFF !important;
}
.btn--primary:hover { background: var(--red-2) !important; }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; box-shadow: none; }
.btn--ghost:hover { background: rgba(255, 255, 255, .1); color: inherit; }
.btn--small { font-size: .9rem; padding: .6em 1em; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Top bar & header ---------- */
.topbar { background: var(--green); color: #E3F2E9; font-family: var(--font-display); font-size: .875rem; }
.topbar__in { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: .45rem; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
.topbar__contact { display: flex; gap: 1.25rem; flex-wrap: wrap; }
@media (max-width: 640px) { .topbar__motto, .topbar__email { display: none; } .topbar__in { justify-content: center; } }

.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__in { display: flex; align-items: center; gap: 1.5rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text); flex: none; }
.brand img, .custom-logo { max-height: 52px; width: auto; }
.brand__mark { width: 44px; height: 44px; display: grid; place-items: center; background: var(--black); color: var(--red-bright); font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; border-radius: var(--book); box-shadow: inset 5px 0 0 rgba(0,0,0,.25); flex: none; }
.brand__text { font-family: var(--font-display); line-height: 1; }
.brand__name { display: block; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand__sub { display: block; font-size: .8rem; color: var(--muted); margin-top: .2rem; }

.primary-nav { margin-left: auto; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav .menu { display: flex; gap: .15rem; align-items: center; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; white-space: nowrap; padding: .55rem .7rem; font-family: var(--font-display); font-weight: 500; font-size: .98rem; color: var(--text); text-decoration: none; border-radius: 6px; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a { background: var(--chip); }
.primary-nav .menu-item-has-children > a::after { content: ""; display: inline-block; width: .4em; height: .4em; margin-left: .45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-.2em) rotate(45deg); opacity: .6; }
.primary-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; box-shadow: var(--shadow); }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
.primary-nav .sub-menu a { font-size: .94rem; white-space: normal; }

.header-actions { display: flex; align-items: center; gap: .35rem; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--chip); }
.icon-btn svg { width: 22px; height: 22px; }
.ig-cart-count { position: absolute; top: 3px; right: 1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #FFFFFF; font: 700 .7rem/19px var(--font-display); text-align: center; }
.ig-cart-count:empty, .ig-cart-count[data-count="0"] { display: none; }
.nav-toggle { display: none; }
.header-search { border-top: 1px solid var(--line); padding-block: 1rem; }
.header-search[hidden] { display: none; }

.search-form { display: flex; gap: .5rem; max-width: 640px; }
.search-form input[type="search"] { flex: 1; }

@media (max-width: 1200px) {
  .nav-toggle { display: inline-grid; }
  .header-cta { display: none; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); padding: .75rem 1.25rem 1.25rem; max-height: calc(100vh - 120px); overflow-y: auto; box-shadow: var(--shadow); }
  .primary-nav.is-open { display: block; }
  .primary-nav .menu { flex-direction: column; align-items: stretch; }
  .primary-nav a { padding: .7rem .5rem; font-size: 1.05rem; }
  .primary-nav .sub-menu { display: block; position: static; box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; margin: 0 0 .4rem .6rem; padding: 0 0 0 .4rem; min-width: 0; }
  .primary-nav .menu-item-has-children > a::after { display: none; }
  .header-actions { margin-left: auto; }
}

.nav-search { display: none; }
@media (max-width: 1200px) { .nav-search { display: block; margin-top: 1rem; } .nav-search .search-form { max-width: none; } }
@media (max-width: 520px) {
  .site-header__in { gap: .5rem; min-height: 66px; }
  .brand { gap: .5rem; }
  .brand__mark { width: 38px; height: 38px; font-size: .95rem; }
  .brand__name { font-size: 1rem; }
  .brand__sub { display: none; }
  .header-actions { gap: 0; }
  .icon-btn { width: 40px; }
  .header-search-btn { display: none; }
}

/* ---------- Hero with bookshelf ---------- */
.hero { background: var(--black); color: #F5F5F5; overflow: hidden; }
.hero__in { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: end; padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3rem, 6vw, 5rem); }
.hero h1 { font-size: clamp(2.9rem, 7.2vw, 5.9rem); font-weight: 800; line-height: .94; letter-spacing: -.045em; max-width: 11ch; margin-bottom: .35em; }
.hero__lead { font-size: clamp(1.1rem, 1.6vw, 1.28rem); color: #D9D9D9; max-width: 36rem; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero__note { margin-top: 2rem; font-family: var(--font-display); font-size: .92rem; color: #A8A8A8; }
.hero__note a { color: #fff; }

.shelf-wrap { position: relative; min-width: 0; }
.shelf { display: flex; align-items: flex-end; gap: 7px; height: 430px; padding: 0 .75rem; }
.shelf__ledge { height: 14px; background: var(--red); border-radius: 2px; box-shadow: 0 16px 24px -10px rgba(0,0,0,.55); }
.shelf__caption { margin-top: .9rem; font-family: var(--font-display); font-size: .9rem; color: #A8A8A8; }
.spine {
  --h: 90%; --w: 62px; --c: #F4B41A; --fg: #2A1F00; --i: 0;
  flex: none; height: var(--h); width: var(--w); background: var(--c); color: var(--fg);
  border-radius: 3px 3px 1px 1px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 16px 0 12px; text-decoration: none;
  box-shadow: inset 7px 0 0 rgba(255,255,255,.1), inset -4px 0 0 rgba(0,0,0,.18);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
  animation: spine-in .7s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i) * 80ms + 150ms);
}
.spine::before { content: ""; width: 58%; height: 7px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: .5; flex: none; }
.spine:hover, .spine:focus-visible { transform: translateY(-16px); text-decoration: none; }
.spine:last-child { transform-origin: bottom left; transform: rotate(-7deg) translateX(10px); }
.spine:last-child:hover, .spine:last-child:focus-visible { transform: rotate(-7deg) translate(10px, -16px); }
.spine__title { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: .01em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: calc(100% - 70px); }
.spine__mark { font-family: var(--font-display); font-weight: 800; font-size: .72rem; opacity: .75; flex: none; }
@keyframes spine-in { from { transform: translateY(50px); opacity: 0; } }

@media (max-width: 900px) {
  .hero__in { grid-template-columns: 1fr; }
  .spine__title { font-size: .86rem; }
  .shelf { height: 340px; overflow-x: auto; overflow-y: hidden; padding-top: 24px; scrollbar-width: none; }
  .shelf::-webkit-scrollbar { display: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section--surface { background: var(--surface); }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem 4rem; align-items: end; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { margin: 0; max-width: 18ch; }
.section-head p { margin: 0; color: var(--muted); font-size: 1.1rem; max-width: 34rem; }
.section-head--row { grid-template-columns: 1fr auto; }
.section-head__link { font-family: var(--font-display); font-weight: 600; }
@media (max-width: 800px) { .section-head, .section-head--row { grid-template-columns: 1fr; } }

/* Services */
.services { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.service { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .7fr); gap: 1.25rem 3rem; align-items: start; padding-block: 2.25rem; border-top: 1px solid var(--line); }
.service h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 700; margin: 0; }
.service h3 a { color: var(--text); text-decoration: none; }
.service h3 a:hover { text-decoration: underline; }
.service p { color: var(--muted); margin-bottom: 1rem; max-width: 46ch; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.tags li { font-family: var(--font-display); font-size: .84rem; background: var(--chip); padding: .3rem .7rem; border-radius: 3px 10px 10px 3px; }
.service__link { font-family: var(--font-display); font-weight: 600; align-self: center; justify-self: end; text-align: right; }
@media (max-width: 800px) { .service { grid-template-columns: 1fr; } .service__link { align-self: start; justify-self: start; text-align: left; } }

/* Process (a true sequence, so it is numbered) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2rem; counter-reset: step; }
.step { counter-increment: step; border-top: 3px solid var(--black); padding-top: 1.25rem; }
.step::before { content: counter(step); display: block; font-family: var(--font-display); font-weight: 800; font-size: 3.2rem; line-height: 1; color: var(--red);  margin-bottom: .75rem; }
.step h3 { font-size: 1.2rem; }
.step p { color: var(--muted); font-size: 1rem; margin: 0; }
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
:root[data-theme="dark"] .step { border-top-color: var(--red); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .step { border-top-color: var(--red); } :root:not([data-theme="light"]) .step::before { color: var(--red-bright); } }
:root[data-theme="dark"] .step::before { color: var(--red-bright); }

/* Values */
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.values h3 { font-size: 1.6rem; }
.values p { color: var(--muted); margin: 0; }
@media (max-width: 800px) { .values { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Journal band */
.band { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 10px solid var(--green); border-radius: var(--book); padding: clamp(1.5rem, 4vw, 2.5rem); }
.band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: .3em; }
.band p { margin: 0; color: var(--muted); }
@media (max-width: 700px) { .band { grid-template-columns: 1fr; } }

/* News */
.news { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.news article { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.news time { font-family: var(--font-display); font-size: .88rem; color: var(--muted); }
.news h3 { margin: .4rem 0 .6rem; }
.news h3 a { color: var(--text); text-decoration: none; }
.news h3 a:hover { text-decoration: underline; }
.news p { color: var(--muted); font-size: 1rem; }
@media (max-width: 800px) { .news { grid-template-columns: 1fr; } }

/* CTA */
.cta { background: var(--red); color: #FFFFFF; }
.cta__in { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: end; padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.cta h2 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.035em; margin: 0; max-width: 14ch; }
.cta p { font-size: 1.1rem; }
.cta .btn { background: var(--black); color: #fff; }
.cta .btn:hover { background: var(--black-2); }
.cta .btn--ghost { background: transparent; color: #FFFFFF; }
.cta .btn--ghost:hover { background: rgba(255,255,255,.12); color: #FFFFFF; }
.cta__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 800px) { .cta__in { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: #D4D4D4; border-top: 6px solid var(--red); font-size: .98rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; padding-block: 4rem 3rem; }
.site-footer h2 { font-size: 1rem; color: #fff; letter-spacing: 0; margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-brand p { max-width: 32ch; }
.footer-motto { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; color: #FFFFFF; line-height: 1.05; letter-spacing: -.03em; margin-bottom: 1rem; }
.footer-contact { font-style: normal; display: grid; gap: .35rem; }
.linklike { background: none; border: 0; padding: 0; color: #fff; font: inherit; cursor: pointer; text-align: left; }
.linklike:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-block: 1.25rem; font-family: var(--font-display); font-size: .85rem; color: #A8A8A8; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.footer-widgets { padding-bottom: 2.5rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Inner pages ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; letter-spacing: -.035em; margin: 0; max-width: 20ch; }
.page-head .meta { margin-top: .75rem; color: var(--muted); font-family: var(--font-display); font-size: .95rem; }
.content-area { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.prose { max-width: 72ch; }
.prose--wide { max-width: none; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.5em 0; padding: .5em 0 .5em 1.25em; border-left: 4px solid var(--red); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--font-display); background: var(--chip); }
.prose img { border-radius: 8px; }
.legal-note { background: var(--chip); border-left: 4px solid var(--red); padding: 1rem 1.25rem; border-radius: 0 8px 8px 0; font-size: .95rem; }
.featured-image { margin-bottom: 2rem; border-radius: 12px; overflow: hidden; }
.post-list { display: grid; gap: 2.5rem; max-width: 820px; }
.post-list article { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.post-list h2 { font-size: 1.7rem; }
.post-list h2 a { color: var(--text); text-decoration: none; }
.pagination, .nav-links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 3rem; font-family: var(--font-display); }
.page-numbers { padding: .45rem .85rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--text); }
.page-numbers.current { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="search"], input[type="password"], input[type="number"], input[type="url"], textarea, select,
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 8px; padding: .7rem .85rem; line-height: 1.4;
}
input:focus, textarea:focus, select:focus { border-color: var(--green-2); outline: 3px solid rgba(11,122,62,.3); outline-offset: 0; }
label { font-family: var(--font-display); font-weight: 500; font-size: .95rem; }

/* ---------- WooCommerce ---------- */
.shop-wrap { padding-block: clamp(2rem, 5vw, 3.5rem); }
.woocommerce-products-header__title, .woocommerce .page-title { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; }
.woocommerce-result-count { color: var(--muted); font-family: var(--font-display); font-size: .92rem; }
.woocommerce-ordering { margin-bottom: 2rem; }
ul.products, .woocommerce ul.products { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(min(230px, 42vw), 1fr)); gap: 2.5rem 1.75rem; list-style: none; margin: 0 0 2rem; padding: 0; }
ul.products::before, ul.products::after { display: none !important; }
ul.products li.product { position: relative; width: auto !important; float: none !important; margin: 0 !important; padding: 0; display: flex; flex-direction: column; }
ul.products li.product a { text-decoration: none; color: var(--text); }
ul.products li.product img, .ig-cover { width: 100%; aspect-ratio: 4 / 5; object-fit: contain; background: var(--cover-bg); padding: 1.1rem; border-radius: var(--book); margin: 0 0 1rem !important; box-shadow: inset 6px 0 0 rgba(0,0,0,.06); }
ul.products li.product .woocommerce-loop-product__title, ul.products li.product h2 { font-family: var(--font-display); font-size: 1.08rem !important; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; margin: 0 0 .35rem; padding: 0 !important; }
.price { font-family: var(--font-display); font-weight: 700; color: var(--text) !important; font-size: 1.05rem !important; }
.price del { color: var(--muted); font-weight: 400; margin-right: .35em; opacity: .8; }
.price ins { text-decoration: none; }
ul.products li.product .price { display: block; margin-bottom: 1rem; }
ul.products li.product .button { margin-top: auto; align-self: flex-start; font-size: .92rem; padding: .6em 1.05em; }
.onsale, .woocommerce span.onsale { position: absolute; top: .75rem; left: .75rem; z-index: 2; min-height: 0 !important; min-width: 0 !important; line-height: 1.2 !important; margin: 0 !important; background: var(--red) !important; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .8rem; padding: .3rem .65rem !important; border-radius: 3px 10px 10px 3px !important; }
.added_to_cart { display: inline-block; margin-top: .5rem; font-family: var(--font-display); font-size: .9rem; }

.woocommerce div.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem 4rem; position: relative; }
.woocommerce div.product div.images, .woocommerce div.product div.summary { width: auto !important; float: none !important; margin: 0 !important; }
.woocommerce div.product div.images img { background: var(--cover-bg); border-radius: 12px; padding: 1.5rem; }
.woocommerce div.product .product_title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.03em; }
.woocommerce div.product .woocommerce-tabs, .woocommerce div.product .related, .woocommerce div.product .upsells { grid-column: 1 / -1; }
.woocommerce div.product form.cart { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: 1.5rem 0; }
.woocommerce .quantity .qty { width: 5rem; text-align: center; }
.woocommerce div.product .woocommerce-tabs ul.tabs { padding: 0; margin: 0 0 1.5rem; border-bottom: 1px solid var(--line); display: flex; gap: .5rem; list-style: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs::before, .woocommerce div.product .woocommerce-tabs ul.tabs li::before, .woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { background: none !important; border: 0 !important; margin: 0 !important; padding: 0 !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a { display: block; padding: .7rem 1rem; font-family: var(--font-display); font-weight: 600; color: var(--muted); }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--text); box-shadow: inset 0 -3px 0 var(--red); }
.woocommerce .col2-set { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.woocommerce .col2-set .col-1, .woocommerce .col2-set .col-2 { width: auto; float: none; }
.woocommerce form .form-row { padding: 0; margin: 0 0 1rem; }
.woocommerce-message, .woocommerce-info, .woocommerce-error { border-top-color: var(--green) !important; background: var(--surface) !important; color: var(--text) !important; border-radius: 0 0 8px 8px; }
.woocommerce table.shop_table { border-radius: 10px; background: var(--surface); border-color: var(--line); }
@media (max-width: 800px) {
  .woocommerce div.product, .woocommerce .col2-set { grid-template-columns: 1fr; }
}

/* ---------- Cookie consent ---------- */
.cookie-banner { position: fixed; left: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 120; width: min(460px, calc(100% - 2rem)); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 8px solid var(--red); border-radius: var(--book); padding: 1.35rem 1.4rem; box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); }
.cookie-banner[hidden], .cookie-modal[hidden] { display: none; }
.cookie-banner h2 { font-size: 1.2rem; margin-bottom: .4rem; letter-spacing: -.01em; }
.cookie-banner p { font-size: .95rem; color: var(--muted); margin-bottom: 1rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.cookie-actions .btn { font-size: .9rem; padding: .65em 1em; }
.cookie-actions .btn--ghost { color: var(--text); }
.cookie-actions .btn--ghost:hover { background: var(--chip); }
.cookie-modal { position: fixed; inset: 0; z-index: 130; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 1rem; }
.cookie-modal__box { width: min(560px, 100%); max-height: calc(100% - 2rem); overflow-y: auto; background: var(--surface); color: var(--text); border-radius: 14px; padding: 1.75rem; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.cookie-modal__box h2 { font-size: 1.5rem; }
.cookie-cat { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: center; padding: 1rem 0; border-top: 1px solid var(--line); }
.cookie-cat h3 { font-size: 1.05rem; margin: 0; }
.cookie-cat p { grid-column: 1; margin: 0; font-size: .92rem; color: var(--muted); }
.cookie-cat .always { font-family: var(--font-display); font-size: .85rem; color: var(--muted); grid-row: 1 / span 2; grid-column: 2; }
.switch { position: relative; width: 52px; height: 30px; grid-row: 1 / span 2; grid-column: 2; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 30px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--green-2); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
@media (max-width: 560px) { .cookie-banner { left: 0; bottom: 0; width: 100%; border-radius: 14px 14px 0 0; border-left: 0; border-top: 6px solid var(--red); padding-bottom: calc(1.35rem + env(safe-area-inset-bottom, 0px)); } body.ig-banner-open .chat-launcher { display: none; } }

/* ---------- Chatbot ---------- */
.chat-launcher { position: fixed; right: 1.1rem; bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)); z-index: 110; display: inline-flex; align-items: center; gap: .55rem; padding: .85rem 1.2rem .85rem 1rem; border: 0; border-radius: var(--book); background: var(--red); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1rem; cursor: pointer; box-shadow: inset 6px 0 0 rgba(0,0,0,.25), 0 14px 30px -10px rgba(0,0,0,.55); }
.chat-launcher svg { width: 22px; height: 22px; color: var(--red); }
.chat-launcher:hover { background: var(--red-2); }
.chat-launcher[aria-expanded="true"] { display: none; }
.chat-panel { position: fixed; right: 1.1rem; bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)); z-index: 115; width: min(390px, calc(100% - 2.2rem)); height: min(620px, calc(100vh - 7rem)); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); transform-origin: bottom right; animation: chat-open .22s ease-out; }
.chat-panel[hidden] { display: none; }
@keyframes chat-open { from { transform: scale(.94) translateY(10px); opacity: 0; } }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; background: var(--black); border-bottom: 4px solid var(--red); color: #fff; }
.chat-head .brand__mark { width: 38px; height: 38px; font-size: .95rem; }
.chat-head h2 { font-size: 1.05rem; margin: 0; letter-spacing: -.01em; color: #fff; }
.chat-head p { margin: 0; font-family: var(--font-display); font-size: .8rem; color: #A8A8A8; }
.chat-head .icon-btn { margin-left: auto; color: #fff; }
.chat-head .icon-btn:hover { background: rgba(255,255,255,.12); }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--bg); }
.msg { max-width: 86%; padding: .65rem .9rem; font-size: .96rem; line-height: 1.5; border-radius: 4px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); }
.msg p { margin: 0 0 .5em; } .msg p:last-child { margin: 0; }
.msg ul { margin: .3em 0 .5em; padding-left: 1.1em; }
.msg--user { align-self: flex-end; background: var(--green); color: #fff; border-color: var(--green); border-radius: 14px 4px 4px 14px; }
.msg--note { max-width: 100%; background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: .85rem; }
.msg .btn { margin-top: .5rem; font-size: .88rem; padding: .55em .9em; white-space: normal; text-align: left; }
.msg .btn + .btn { margin-left: .35rem; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }
.chat-chips { display: flex; gap: .4rem; flex-wrap: wrap; padding: .6rem 1rem; border-top: 1px solid var(--line); background: var(--surface); }
.chat-chips:empty { display: none; }
.chip { font-family: var(--font-display); font-size: .84rem; padding: .4rem .75rem; border-radius: 3px 12px 12px 3px; border: 1.5px solid var(--green-2); background: transparent; color: var(--text); cursor: pointer; }
.chip:hover { background: var(--chip); }
.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form input { flex: 1; border-radius: 10px; }
.chat-form button { flex: none; width: 46px; height: 46px; padding: 0; border-radius: 3px 12px 12px 3px; }
.chat-form button svg { width: 20px; height: 20px; }
.lead-form { display: grid; gap: .5rem; margin-top: .5rem; position: relative; }
.lead-form input, .lead-form textarea { font-size: .92rem; padding: .55rem .7rem; }
.lead-form label.consent { display: flex; gap: .5rem; align-items: flex-start; font-family: var(--font-body); font-weight: 400; font-size: .82rem; line-height: 1.4; color: var(--muted); }
.lead-form label.consent input { width: auto; margin-top: .2rem; flex: none; }
.lead-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead-form .form-error { color: var(--red); font-size: .85rem; margin: 0; }
@media (max-width: 560px) {
  .chat-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .chat-launcher span { display: none; }
  .chat-launcher { padding: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print { .site-header, .topbar, .chat-launcher, .chat-panel, .cookie-banner, .site-footer { display: none !important; } }

/* ---------- Logo ---------- */
.brand__logo { height: 56px; width: auto; }
.brand__logo--light { display: none; }
:root[data-theme="dark"] .brand__logo--dark { display: none; }
:root[data-theme="dark"] .brand__logo--light { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand__logo--dark { display: none; }
  :root:not([data-theme="light"]) .brand__logo--light { display: block; }
}
.footer-logo { height: 56px; width: auto; margin-bottom: 1.25rem; }
.chat-head__mark { width: 34px; height: auto; flex: none; }
.chat-launcher img { width: 24px; height: auto; }
.hero :focus-visible, .site-footer :focus-visible, .cta :focus-visible, .topbar :focus-visible, .chat-head :focus-visible { outline-color: #FFFFFF; }
@media (max-width: 520px) { .brand__logo { height: 42px; } }
