/*
Theme Name: LDB Publishing
Description: Custom WooCommerce theme for Leslie D. Bernard — spiritual & self-help fiction.
Author: (your name)
Version: 1.0
Text Domain: ldb-publishing
*/

:root{
  --cream:#FBF6EC;
  --cream-deep:#F3EAD8;
  --forest:#1F3D2D;
  --forest-deep:#173025;
  --rose:#E8AFB4;
  --rose-deep:#D0818A;
  --sky:#A8C7D6;
  --gold:#C9A34E;
  --gold-light:#E4C583;
  --ink:#26281F;
  --ink-soft:#5C5B4E;
  --line: rgba(31,61,45,0.14);
  --display: 'Fraunces', serif;
  --body: 'Inter', sans-serif;
}

*{box-sizing:border-box;}
body{
  background:var(--cream);
  color:var(--ink);
  font-family:var(--body);
  line-height:1.55;
  margin:0;
}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}
.wrap{max-width:1200px;margin:0 auto;padding:0 32px;}

/* ---------- Header ---------- */
.site-header{
  position:sticky;top:0;z-index:60;
  background:rgba(251,246,236,0.95);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.nav-inner{display:flex !important;align-items:center;justify-content:space-between;height:88px;flex-wrap:nowrap !important;gap:20px;}
.nav-right{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;flex-shrink:0;}
.nav-actions{display:flex;align-items:center;gap:8px;flex-shrink:0;}
.site-logo{display:flex;align-items:center;gap:12px;}
.site-logo-img{height:36px;width:auto;display:block;}
.site-logo-img-footer{height:32px;filter:brightness(0) saturate(100%) invert(94%) sepia(8%) saturate(400%) hue-rotate(357deg) brightness(103%);}
.site-logo .name{font-family:var(--display);font-weight:600;font-size:1.3rem;color:var(--forest-deep);}
.site-logo .sub{font-family:var(--display);font-style:italic;font-size:0.78rem;color:var(--ink-soft);}
.primary-nav{display:flex;align-items:center;gap:2px;flex-shrink:0;}
.primary-nav ul{list-style:none;display:flex;align-items:center;gap:2px;margin:0;padding:0;}
.primary-nav a{font-size:0.86rem;font-weight:500;color:var(--forest-deep);padding:10px 15px;display:block;white-space:nowrap;}

/*
  About and Subscribe are meant to be footer-only. If a real
  WordPress Menu in Appearance > Menus still has them added, the
  theme's fallback menu code can't override that — so this hides
  them directly by their destination URL instead, guaranteeing they
  never show in the header regardless of what the live Menu contains.
  They're unaffected in the footer, since this only targets links
  inside .primary-nav specifically.
*/
.primary-nav a[href$="/about"],
.primary-nav a[href$="/about/"],
.primary-nav a[href$="/subscribe"],
.primary-nav a[href$="/subscribe/"]{
  display:none !important;
}
.primary-nav a:hover{color:var(--gold);}

/* ---------- Buttons ---------- */
.btn-solid{background:var(--forest-deep);color:var(--cream);padding:14px 26px;font-size:0.78rem;font-weight:700;letter-spacing:0.03em;text-transform:uppercase;border-radius:2px;display:inline-block;border:none;cursor:pointer;}
.btn-solid:hover{background:var(--forest);color:var(--cream);}
.btn-soft{background:var(--rose);color:#4E262A;padding:14px 26px;font-size:0.78rem;font-weight:700;letter-spacing:0.03em;text-transform:uppercase;border-radius:2px;display:inline-block;border:none;cursor:pointer;}
.btn-soft:hover{background:var(--rose-deep);}
.btn-outline{background:transparent;border:1px solid var(--forest-deep);color:var(--forest-deep);padding:10px 18px;font-size:0.72rem;font-weight:700;text-transform:uppercase;border-radius:2px;display:inline-block;}
.btn-outline:hover{background:var(--forest-deep);color:var(--cream);}

/* ---------- Hero (full-bleed photo background) ---------- */
.hero{padding:0;position:relative;overflow:hidden;min-height:600px;display:flex;align-items:center;background:var(--forest-deep);}
.hero-bg-img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  z-index:1;
}
.hero-overlay{
  position:absolute;
  inset:0;
  z-index:2;
  background:linear-gradient(100deg,
    rgba(23,48,37,0.92) 0%,
    rgba(23,48,37,0.78) 32%,
    rgba(23,48,37,0.35) 58%,
    rgba(23,48,37,0.05) 78%,
    transparent 100%
  );
}
.hero-overlay-content{position:relative;z-index:3;padding:90px 32px;width:100%;}
.hero .hero-overlay-content h1{color:#FBF6EC;}
.hero .hero-overlay-content h1 em{color:var(--gold-light);}
.hero .hero-overlay-content .tagline{color:var(--gold-light);}
.hero .hero-overlay-content p.lede{color:rgba(251,246,236,0.88);max-width:440px;}

@media (max-width:900px){
  .hero{min-height:520px;}
  .hero-overlay{background:linear-gradient(180deg,
    rgba(23,48,37,0.55) 0%,
    rgba(23,48,37,0.88) 55%,
    rgba(23,48,37,0.95) 100%
  );}
  .hero-overlay-content{padding:60px 20px;}
}
@media (max-width:560px){
  .hero{min-height:460px;}
}
.hero h1{font-family:var(--display);font-weight:400;font-size:clamp(2.3rem,4.4vw,3.5rem);line-height:1.12;color:var(--forest-deep);margin:0 0 14px;}
.hero h1 em{font-style:italic;color:var(--gold);}
.hero .tagline{font-family:var(--display);font-style:italic;font-size:1.05rem;color:var(--forest);margin-bottom:14px;}
.hero p.lede{color:var(--ink-soft);max-width:420px;margin-bottom:30px;}
.hero-actions{display:flex;gap:14px;flex-wrap:wrap;}

/* ---------- Stats ---------- */
.stats-bar{background:var(--cream-deep);padding:44px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);text-align:center;}
.stats-grid .num{font-family:var(--display);font-size:2rem;font-weight:500;color:var(--forest-deep);}
.stats-grid .label{font-size:0.7rem;letter-spacing:0.08em;text-transform:uppercase;font-weight:700;color:var(--forest);margin:6px 0;}
.stats-grid .desc{font-size:0.78rem;color:var(--ink-soft);}

/* ---------- Category / book cards ---------- */
.section{padding:70px 0;}
.section-eyebrow{font-size:0.7rem;letter-spacing:0.2em;text-transform:uppercase;color:var(--gold);font-weight:700;text-align:center;margin-bottom:10px;}
.section-title{font-family:var(--display);font-weight:400;font-size:2rem;color:var(--forest-deep);text-align:center;margin-bottom:44px;}

.book-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:26px;}
.explore-grid-5{grid-template-columns:repeat(5,1fr);}

.explore-card{display:block;}
.explore-card-visual{height:170px;overflow:hidden;position:relative;}
.explore-card-photo{width:100%;height:100%;object-fit:cover;display:block;transition:transform .5s ease;}
.explore-card:hover .explore-card-photo{transform:scale(1.06);}
.explore-card .body{padding:20px 18px 24px;}
.book-card{background:#fff;border:1px solid var(--line);border-radius:4px;overflow:hidden;transition:transform .2s ease, box-shadow .2s ease;}
.book-card:hover{transform:translateY(-4px);box-shadow:0 18px 36px -18px rgba(23,48,37,0.25);}
.book-card .cover img{height:200px;width:100%;object-fit:cover;}
.book-card .cover{position:relative;}
.tag-free{position:absolute;top:10px;right:10px;background:var(--rose);color:#4A2226;font-size:0.6rem;font-weight:700;padding:4px 9px;border-radius:20px;}
.book-card .body{padding:18px 18px 22px;}
.book-card h3{font-family:var(--display);font-weight:500;font-size:1rem;margin:0 0 6px;}
.book-card .price{font-family:var(--display);font-weight:600;color:var(--forest-deep);}

/* ---------- Footer ---------- */
.site-footer{background:var(--forest-deep);color:rgba(251,246,236,0.75);padding:60px 0 24px;}
.social-row{display:flex;gap:10px;margin-top:20px;flex-wrap:wrap;}
.social-row a{width:36px;height:36px;border:1px solid var(--gold);border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--gold-light);transition:.2s ease;}
.social-row a:hover{background:var(--gold);color:var(--forest-deep);}
.social-row svg{width:15px;height:15px;}
.footer-grid{display:grid;grid-template-columns:1.3fr 1fr 1fr 1fr;gap:40px;padding-bottom:36px;border-bottom:1px solid rgba(251,246,236,0.14);}
.footer-grid h4{font-size:0.68rem;letter-spacing:0.16em;text-transform:uppercase;color:var(--gold);margin-bottom:16px;font-weight:700;}
.footer-grid ul{list-style:none;margin:0;padding:0;}
.footer-grid li{margin-bottom:10px;font-size:0.85rem;}
.footer-bottom{text-align:center;padding-top:22px;font-size:0.78rem;opacity:0.6;}

/* ---------- Scroll-reveal animations ---------- */
.reveal{opacity:0;transform:translateY(18px);transition:opacity .7s ease, transform .7s ease;}
.reveal.in{opacity:1;transform:translateY(0);}
@media (prefers-reduced-motion: reduce){
  .reveal{opacity:1;transform:none;transition:none;}
}

/* Hero breathing ring motif */
@keyframes ldb-breathe{
  0%,100%{transform:scale(1);opacity:0.45;}
  50%{transform:scale(1.05);opacity:0.75;}
}
.ring{position:relative;}
.ring::before{content:'';position:absolute;inset:0;border:1px solid var(--gold);border-radius:50%;opacity:0.55;}
@media (prefers-reduced-motion: no-preference){
  .ring.breathing::before{animation: ldb-breathe 7s ease-in-out infinite;}
}

/* Card hover lift already defined above; add smoother easing globally */
.book-card, .ex-card{will-change:transform;}

/* ---------- More dropdown (hidden-tab categories) ---------- */
.more-wrap{position:relative;}

/*
  Fully custom language switcher (functions.php,
  ldb_custom_language_switcher()). Transparent, blends into the nav
  like the other links — flag + language name + chevron, underlines
  on hover to read clearly as part of the navigation.
*/
/*
  Force-hides TranslatePress's FLOATING language switcher, in case
  it's still enabled in TranslatePress's own settings. The header now
  has its own fully custom switcher — this prevents a duplicate one
  from floating in the corner of the page.
*/
#trp-floater-ls,
.trp-floater-ls-container,
[id*="trp-floater"],
[class*="trp-floater"]{
  display:none !important;
}

/*
  TranslatePress wraps individual translatable words/phrases in inline
  spans site-wide so it can track and swap them per-language. Some
  browsers apply a default focus outline to these spans when they
  briefly receive focus (e.g. during a click or drag), which shows up
  as a stray blue box around a single word — visible on things like
  the WooCommerce "No order has been made yet" text. This removes
  that outline from TranslatePress's wrapper spans specifically,
  without affecting real focus rings on genuinely interactive
  elements like buttons and links (accessibility-safe).
*/
[class*="trp-"]:focus,
[data-trp-original-text]:focus,
span[class*="trp"]:focus{
  outline:none !important;
}

.ldb-lang-switcher{position:relative;flex-shrink:0;}
.ldb-lang-btn{
  display:flex;align-items:center;gap:6px;
  background:transparent;
  color:var(--forest-deep);
  border:none;
  padding:10px 10px;
  font-size:0.85rem;
  font-weight:500;
  font-family:var(--body);
  cursor:pointer;
  white-space:nowrap;
  position:relative;
}
.ldb-lang-btn::after{
  content:'';
  position:absolute;left:10px;right:10px;bottom:6px;
  height:1px;background:var(--gold);
  transform:scaleX(0);transform-origin:left;
  transition:transform .25s ease;
}
.ldb-lang-btn:hover::after{transform:scaleX(1);}
.ldb-lang-btn svg{width:8px;flex-shrink:0;transition:transform .2s ease;color:var(--ink-soft);}
.ldb-lang-switcher.open .ldb-lang-btn svg{transform:rotate(180deg);}
.ldb-lang-flag{width:16px;height:auto;flex-shrink:0;display:block;border-radius:2px;}

.ldb-lang-panel{
  display:none;
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  min-width:170px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:4px;
  box-shadow:0 20px 44px -12px rgba(23,48,37,0.22);
  padding:6px;
  z-index:200;
  max-height:60vh;
  overflow-y:auto;
}
.ldb-lang-switcher.open .ldb-lang-panel{display:block;}
.ldb-lang-item{
  display:flex;align-items:center;gap:8px;
  padding:9px 10px;
  font-size:0.82rem;
  color:var(--ink);
  border-radius:2px;
  white-space:nowrap;
}
.ldb-lang-item:hover{background:var(--forest-deep);color:var(--cream);}
.ldb-lang-item.is-active{color:var(--forest-deep);font-weight:600;}

.more-btn{background:none;border:none;cursor:pointer;font-family:var(--body);font-size:0.86rem;font-weight:500;color:var(--forest-deep);padding:10px 15px;display:flex;align-items:center;gap:6px;}
.more-btn svg{width:9px;transition:transform .2s ease;}
.more-wrap.open .more-btn svg{transform:rotate(180deg);}
.more-panel{position:absolute;top:calc(100% + 10px);right:0;background:#fff;border:1px solid var(--line);box-shadow:0 20px 44px -12px rgba(23,48,37,0.22);min-width:210px;padding:10px;display:none;border-radius:3px;z-index:70;}
.more-wrap.open .more-panel{display:block;}
.more-item{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;font-size:0.85rem;border-radius:2px;}
.more-item:hover{background:var(--cream-deep);}
.soon-tag{font-size:0.58rem;font-weight:700;letter-spacing:0.05em;background:var(--rose);color:#5A2A2E;padding:3px 8px;border-radius:20px;white-space:nowrap;}

/* ---------- Mobile nav ---------- */
.menu-toggle{display:none;background:none;border:none;cursor:pointer;padding:8px;}
.mobile-nav{display:none;flex-direction:column;gap:2px;padding:14px 20px 20px;border-top:1px solid var(--line);}
.mobile-nav a{padding:10px 0;font-size:0.92rem;color:var(--forest-deep);border-bottom:1px solid var(--line);}
.mobile-nav-soon{padding:10px 0;font-size:0.92rem;color:var(--ink-soft);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;}
.mobile-nav.open{display:flex;}

/* ---------- Category archive banner ---------- */
.category-banner{background:var(--cream-deep);padding:56px 0;text-align:center;border-bottom:1px solid var(--line);}
.category-banner h1{font-family:var(--display);font-weight:400;font-size:2.1rem;color:var(--forest-deep);margin:0 0 10px;}
.category-banner p{color:var(--ink-soft);max-width:520px;margin:0 auto;}

/* ---------- Explicit warning banner already inline in functions.php ---------- */

/* ---------- Single Product Page ---------- */
.ldb-product-page{padding:56px 0 80px;}
.ldb-product-grid{display:grid;grid-template-columns:0.9fr 1fr;gap:56px;align-items:flex-start;}

.ldb-product-gallery{position:sticky;top:110px;}
.ldb-product-gallery img{border-radius:4px;box-shadow:0 30px 60px -24px rgba(23,48,37,0.28);}
.woocommerce-product-gallery__image{border-radius:4px;overflow:hidden;}
.flex-control-thumbs{list-style:none;display:flex;gap:8px;margin:14px 0 0;padding:0;}
.flex-control-thumbs li{width:64px;}
.flex-control-thumbs img{border-radius:2px;border:1px solid var(--line);cursor:pointer;}

.ldb-product-eyebrow{font-size:0.7rem;letter-spacing:0.16em;text-transform:uppercase;color:var(--gold);font-weight:700;margin-bottom:12px;}
.ldb-product-summary h1.product_title{font-family:var(--display);font-weight:400;font-size:2.1rem;color:var(--forest-deep);margin:0 0 14px;line-height:1.15;}
.ldb-product-summary .price{font-family:var(--display);font-size:1.5rem;color:var(--forest-deep);font-weight:600;margin-bottom:18px;display:block;}
.ldb-product-summary .price del{opacity:0.5;font-size:0.85em;margin-right:8px;}
.ldb-product-summary .price ins{text-decoration:none;}
.ldb-product-summary .woocommerce-product-details__short-description{color:var(--ink-soft);font-size:0.98rem;line-height:1.75;margin-bottom:8px;}

/* WooCommerce's native Add to Cart button, restyled to match our system */
.ldb-product-summary .cart{margin-top:22px;}
.ldb-product-summary .single_add_to_cart_button{
  background:var(--forest-deep) !important;
  color:var(--cream) !important;
  padding:15px 30px !important;
  font-size:0.8rem !important;
  font-weight:700 !important;
  letter-spacing:0.03em;
  text-transform:uppercase;
  border-radius:2px !important;
  border:none !important;
}
.ldb-product-summary .single_add_to_cart_button:hover{background:var(--forest) !important;}
.ldb-product-summary .quantity input.qty{
  border:1px solid var(--line);
  border-radius:2px;
  padding:14px 10px;
  width:64px;
  margin-right:10px;
  font-family:var(--body);
}

/* Our custom Buy Paperback / Free Download row (from functions.php) */
.ldb-buy-row{margin-top:16px;display:flex;flex-direction:column;gap:14px;align-items:flex-start;}
.ldb-buy-row .btn-solid, .ldb-buy-row .btn-outline{padding:15px 28px;}

/* Retail tabs — four possible links per paid book (Amazon eBook/Paperback, D2D eBook/Paperback) */
.retail-tabs{display:flex;gap:10px;flex-wrap:wrap;}
.retail-tab{
  background:transparent;
  border:1px solid var(--forest-deep);
  color:var(--forest-deep);
  padding:13px 20px;
  font-size:0.76rem;
  font-weight:700;
  letter-spacing:0.02em;
  text-transform:uppercase;
  border-radius:2px;
  transition:.2s ease;
}
.retail-tab:hover{background:var(--forest-deep);color:var(--cream);}

/* Format choice — radio buttons on the product page before Add to Cart */
.ldb-add-to-cart-form{display:flex;flex-direction:column;gap:14px;}
.format-choice{display:flex;flex-direction:column;gap:8px;}
.format-radio{
  display:flex;align-items:center;gap:10px;
  padding:11px 14px;
  border:1px solid var(--line);
  border-radius:4px;
  cursor:pointer;
  font-size:0.85rem;
  transition:border-color .2s ease, background .2s ease;
}
.format-radio:hover{border-color:var(--gold);}
.format-radio input[type="radio"]{accent-color:var(--forest-deep);width:16px;height:16px;}
.format-radio:has(input:checked){border-color:var(--forest-deep);background:var(--cream-deep);}

/* Order summary page (replaces WooCommerce checkout) */
.order-summary-list{display:flex;flex-direction:column;gap:14px;}
.order-summary-row{
  display:flex;align-items:center;gap:16px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
}
.order-summary-cover{width:52px;flex-shrink:0;}
.order-summary-cover img{border-radius:2px;}
.order-summary-info{flex:1;min-width:0;}
.order-summary-title{font-family:var(--display);font-weight:500;font-size:0.95rem;}
.order-summary-format{font-size:0.78rem;color:var(--ink-soft);}
@media (max-width:560px){
  .order-summary-row{flex-wrap:wrap;}
}

/* Free eBook email gate */
.ldb-free-gate{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.ldb-free-gate input[type="email"]{
  padding:15px 18px;
  border:1px solid var(--line);
  background:#fff;
  font-family:var(--body);
  font-size:0.88rem;
  border-radius:2px;
  min-width:240px;
}
.ldb-free-gate input[type="email"]:focus{outline:2px solid var(--gold);outline-offset:1px;}
.ldb-free-gate button{
  background:var(--forest-deep);
  color:var(--cream);
  border:none;
  padding:15px 26px;
  font-size:0.78rem;
  font-weight:700;
  letter-spacing:0.03em;
  text-transform:uppercase;
  border-radius:2px;
  cursor:pointer;
  white-space:nowrap;
}
.ldb-free-gate button:hover{background:var(--forest);}
.ldb-free-gate button:disabled{opacity:0.7;cursor:default;}
.ldb-free-gate-status{font-size:0.78rem;color:var(--forest);width:100%;}

.woocommerce-product-meta{margin-top:28px;padding-top:20px;border-top:1px solid var(--line);font-size:0.82rem;color:var(--ink-soft);}
.woocommerce-product-meta a{color:var(--forest);text-decoration:underline;}

/* Tabs (Description / Reviews) */
.ldb-product-tabs-wrap{margin-top:64px;}
.woocommerce-tabs ul.tabs{list-style:none;display:flex;gap:8px;padding:0;margin:0 0 28px;border-bottom:1px solid var(--line);}
.woocommerce-tabs ul.tabs li{margin:0;}
.woocommerce-tabs ul.tabs li a{display:block;padding:12px 4px;font-size:0.85rem;font-weight:600;color:var(--ink-soft);border-bottom:2px solid transparent;margin-right:24px;}
.woocommerce-tabs ul.tabs li.active a{color:var(--forest-deep);border-bottom-color:var(--gold);}
.woocommerce-Tabs-panel{color:var(--ink-soft);font-size:0.95rem;line-height:1.8;max-width:720px;}

/* Related products — reuse book-card look */
.related.products{margin-top:70px;}
.related.products > h2{font-family:var(--display);font-weight:400;font-size:1.7rem;color:var(--forest-deep);text-align:center;margin-bottom:36px;}
.related.products ul.products{list-style:none;display:grid;grid-template-columns:repeat(4,1fr);gap:24px;padding:0;margin:0;}
.related.products ul.products li.product{background:#fff;border:1px solid var(--line);border-radius:4px;overflow:hidden;transition:transform .2s ease, box-shadow .2s ease;}
.related.products ul.products li.product:hover{transform:translateY(-4px);box-shadow:0 18px 36px -18px rgba(23,48,37,0.25);}
.related.products ul.products li.product img{height:190px;width:100%;object-fit:cover;}
.related.products ul.products li.product .woocommerce-loop-product__title{font-family:var(--display);font-weight:500;font-size:0.95rem;padding:14px 16px 4px;color:var(--ink);}
.related.products ul.products li.product .price{font-family:var(--display);font-weight:600;color:var(--forest-deep);padding:0 16px 18px;display:block;font-size:0.95rem;}
.related.products ul.products li.product a{text-decoration:none;}

/* ---------- Newsletter Subscribe ---------- */
.subscribe-section{background:linear-gradient(120deg,#F6DCE0 0%, #F3EAD8 45%, #C9DAE0 100%);padding:60px 0;}
.subscribe-inner{display:grid;grid-template-columns:auto 1fr auto;gap:32px;align-items:center;}
.subscribe-envelope{width:100px;height:80px;flex-shrink:0;}
.subscribe-copy h2{font-family:var(--display);font-weight:400;font-size:1.7rem;color:var(--forest-deep);margin:0 0 8px;}
.subscribe-copy p{color:var(--ink-soft);font-size:0.92rem;margin:0;max-width:360px;}
.subscribe-form-block{display:flex;flex-direction:column;gap:10px;min-width:320px;}
.subscribe-form{display:flex;gap:10px;}
.subscribe-form input[type="email"]{flex:1;padding:15px 18px;border:1px solid var(--line);background:#fff;font-family:var(--body);font-size:0.9rem;border-radius:2px;}
.subscribe-form input[type="email"]:focus{outline:2px solid var(--gold);outline-offset:1px;}
.subscribe-form button{background:var(--rose-deep);color:#fff;border:none;padding:15px 26px;font-size:0.78rem;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;cursor:pointer;border-radius:2px;transition:.2s ease;white-space:nowrap;}
.subscribe-form button:hover{background:#C67D85;}
.subscribe-note{font-size:0.76rem;color:var(--ink-soft);display:flex;align-items:center;gap:6px;}

/* Compact version used in the footer */
.footer-subscribe-form{display:flex;flex-direction:column;gap:8px;}
.footer-subscribe-form input[type="email"]{padding:11px 14px;border:1px solid rgba(251,246,236,0.24);background:rgba(251,246,236,0.06);color:var(--cream);font-size:0.85rem;border-radius:2px;}
.footer-subscribe-form input[type="email"]::placeholder{color:rgba(251,246,236,0.5);}
.footer-subscribe-form input[type="email"]:focus{outline:1px solid var(--gold);}
.footer-subscribe-form button{background:var(--gold);color:var(--forest-deep);border:none;padding:11px 16px;font-size:0.75rem;font-weight:700;text-transform:uppercase;cursor:pointer;border-radius:2px;}
.footer-subscribe-form button:hover{background:var(--gold-light);}

/* ---------- FAQ Page ---------- */
.faq-hero{padding:80px 0 60px;text-align:center;background:linear-gradient(180deg,#FDF3E4 0%,#F3EAD8 100%);border-bottom:1px solid var(--line);}
.faq-hero h1{font-family:var(--display);font-weight:400;font-size:clamp(2rem,4vw,2.8rem);color:var(--forest-deep);margin:12px 0;}
.faq-hero p{color:var(--ink-soft);font-size:1rem;}

.faq-accordion{display:flex;flex-direction:column;gap:14px;}
.faq-item{background:#fff;border:1px solid var(--line);border-radius:6px;overflow:hidden;transition:box-shadow .25s ease, border-color .25s ease;}
.faq-item:hover{box-shadow:0 14px 30px -18px rgba(23,48,37,0.2);}
.faq-item.open{border-color:var(--gold);box-shadow:0 18px 36px -18px rgba(23,48,37,0.25);}

.faq-question{
  width:100%;
  display:flex;
  align-items:center;
  gap:16px;
  padding:20px 22px;
  background:none;
  border:none;
  cursor:pointer;
  text-align:left;
  font-family:var(--body);
}
.faq-icon{font-size:1.3rem;flex-shrink:0;width:32px;text-align:center;}
.faq-question-text{flex:1;font-family:var(--display);font-weight:500;font-size:1.02rem;color:var(--ink);}
.faq-chevron{width:20px;height:20px;color:var(--gold);flex-shrink:0;transition:transform .3s ease;display:flex;align-items:center;justify-content:center;}
.faq-item.open .faq-chevron{transform:rotate(180deg);}

.faq-answer{
  max-height:0;
  overflow:hidden;
  transition:max-height .35s ease;
}
.faq-item.open .faq-answer{max-height:400px;}
.faq-answer-inner{
  padding:0 22px 22px 70px;
  color:var(--ink-soft);
  font-size:0.92rem;
  line-height:1.75;
}

.faq-cta{
  margin-top:56px;
  text-align:center;
  padding:44px 30px;
  background:var(--cream-deep);
  border-radius:8px;
}
.faq-cta p{color:var(--ink-soft);margin-bottom:18px;font-size:0.95rem;}

/* ---------- Legal / policy pages ---------- */
.legal-hero{padding:64px 0 48px;text-align:center;background:linear-gradient(180deg,#FDF3E4 0%,#F3EAD8 100%);border-bottom:1px solid var(--line);}
.legal-hero h1{font-family:var(--display);font-weight:400;font-size:clamp(1.9rem,3.6vw,2.6rem);color:var(--forest-deep);margin-top:10px;}

.legal-body-section{padding:60px 0 90px;}
.legal-layout{display:grid;grid-template-columns:220px 1fr;gap:56px;align-items:flex-start;}
.legal-layout.no-toc{grid-template-columns:1fr;justify-items:center;}
.legal-layout.no-toc .legal-content{width:100%;}
/* CSS-only safety net for modern browsers: instantly centers content
   with no sidebar if there's no H3 in it, before JS even runs. */
.legal-layout:has(.legal-content:not(:has(h3))){grid-template-columns:1fr;justify-items:center;}

.legal-toc{position:sticky;top:110px;}
.legal-toc-label{font-size:0.68rem;letter-spacing:0.16em;text-transform:uppercase;color:var(--gold);font-weight:700;margin-bottom:14px;}
.legal-toc ul{list-style:none;margin:0;padding:0;border-left:2px solid var(--line);}
.legal-toc li{margin:0;}
.legal-toc a{
  display:block;
  padding:8px 0 8px 16px;
  font-size:0.84rem;
  color:var(--ink-soft);
  border-left:2px solid transparent;
  margin-left:-2px;
  transition:color .2s ease, border-color .2s ease;
}
.legal-toc a:hover{color:var(--forest-deep);}
.legal-toc a.active{color:var(--forest-deep);border-left-color:var(--gold);font-weight:600;}

.legal-content{max-width:680px;color:var(--ink-soft);font-size:0.98rem;line-height:1.8;}
.legal-content h1{font-family:var(--display);font-size:2rem;color:var(--forest-deep);margin-bottom:20px;}
.legal-content h3{
  font-family:var(--display);
  font-weight:500;
  font-size:1.25rem;
  color:var(--forest-deep);
  margin:44px 0 14px;
  padding-top:8px;
  scroll-margin-top:110px;
}
.legal-content h3:first-of-type{margin-top:0;}
.legal-content p{margin-bottom:16px;}
.legal-content ul, .legal-content ol{margin:0 0 16px 22px;}
.legal-content li{margin-bottom:8px;}
.legal-content a{color:var(--forest-deep);text-decoration:underline;text-decoration-color:var(--gold);text-underline-offset:3px;}
.legal-content a:hover{color:var(--gold);}
.legal-content blockquote{
  border-left:3px solid var(--gold);
  background:var(--cream-deep);
  padding:16px 20px;
  margin:24px 0;
  font-size:0.88rem;
  border-radius:0 4px 4px 0;
}
.legal-content strong{color:var(--ink);}

@media (max-width:900px){
  .hero .wrap{grid-template-columns:1fr;}
  .hero-photo{min-height:260px;max-height:320px;}
  .stats-grid{grid-template-columns:repeat(2,1fr);row-gap:24px;}
  .book-grid{grid-template-columns:repeat(2,1fr);}
  .explore-grid-5{grid-template-columns:repeat(3,1fr);}
  .footer-grid{grid-template-columns:1fr 1fr;}
  .primary-nav{display:none !important;}
  .more-wrap{display:none !important;}
  .ldb-lang-switcher{display:none !important;}
  .nav-actions .btn-outline:not([aria-label="Cart"]){display:none !important;}
  .menu-toggle{display:block !important;}
  .ldb-product-grid{grid-template-columns:1fr;}
  .ldb-product-gallery{position:static;}
  .related.products ul.products{grid-template-columns:repeat(2,1fr);}
  .subscribe-inner{grid-template-columns:1fr;text-align:center;}
  .subscribe-form-block{margin:0 auto;min-width:0;width:100%;max-width:340px;}
  .legal-layout{grid-template-columns:1fr;}
  .legal-toc{position:static;border-left:none;padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid var(--line);}
}
@media (max-width:560px){
  .book-grid{grid-template-columns:1fr;}
  .explore-grid-5{grid-template-columns:1fr;}
  .footer-grid{grid-template-columns:1fr;}
  .related.products ul.products{grid-template-columns:1fr;}
  .subscribe-form{flex-direction:column;}
  .faq-answer-inner{padding-left:22px;}
}

/* ---------- Chatbot widget ---------- */
#ldb-chat-widget{position:fixed;bottom:24px;right:24px;z-index:9000;font-family:var(--body);}
#ldb-chat-bubble{
  width:58px;height:58px;border-radius:50%;
  background:var(--forest-deep);color:var(--cream);
  border:none;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 12px 28px rgba(23,48,37,0.35);
  transition:transform .2s ease, background .2s ease;
}
#ldb-chat-bubble:hover{transform:scale(1.06);background:var(--forest);}
#ldb-chat-panel{
  position:absolute;bottom:74px;right:0;
  width:340px;max-width:calc(100vw - 40px);
  height:440px;max-height:70vh;
  background:var(--cream);
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:0 30px 60px -20px rgba(23,48,37,0.35);
  display:none;
  flex-direction:column;
  overflow:hidden;
}
#ldb-chat-panel.open{display:flex;}
#ldb-chat-header{
  background:var(--forest-deep);color:var(--cream);
  padding:14px 16px;
  display:flex;align-items:center;justify-content:space-between;
  font-family:var(--display);font-weight:500;font-size:0.95rem;
}
#ldb-chat-close{background:none;border:none;color:var(--cream);font-size:1.3rem;cursor:pointer;line-height:1;padding:0 4px;}
#ldb-chat-messages{
  flex:1;overflow-y:auto;
  padding:16px;
  display:flex;flex-direction:column;gap:10px;
}
.ldb-chat-msg{
  max-width:85%;
  padding:10px 14px;
  border-radius:10px;
  font-size:0.85rem;
  line-height:1.5;
}
.ldb-chat-msg-bot{background:var(--cream-deep);color:var(--ink);align-self:flex-start;border-bottom-left-radius:2px;}
.ldb-chat-msg-user{background:var(--forest-deep);color:var(--cream);align-self:flex-end;border-bottom-right-radius:2px;}
.ldb-chat-typing{opacity:0.6;font-style:italic;}
#ldb-chat-form{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line);background:#fff;}
#ldb-chat-input{flex:1;padding:10px 12px;border:1px solid var(--line);border-radius:20px;font-size:0.85rem;font-family:var(--body);}
#ldb-chat-input:focus{outline:2px solid var(--gold);outline-offset:1px;}
#ldb-chat-form button{background:var(--forest-deep);color:var(--cream);border:none;padding:10px 18px;border-radius:20px;font-size:0.8rem;font-weight:600;cursor:pointer;}
#ldb-chat-form button:hover{background:var(--forest);}

@media (max-width:560px){
  #ldb-chat-panel{width:calc(100vw - 32px);right:-8px;}
}

/* ---------- Redirect overlay (free download + retail tab confirmation) ---------- */
#ldb-redirect-overlay{
  position:fixed;inset:0;z-index:9500;
  background:rgba(23,48,37,0.94);
  display:none;
  align-items:center;justify-content:center;
  animation:ldb-overlay-fade .25s ease;
}
#ldb-redirect-overlay.show{display:flex;}
@keyframes ldb-overlay-fade{from{opacity:0;}to{opacity:1;}}
.ldb-redirect-box{text-align:center;color:var(--cream);padding:20px;max-width:360px;}
.ldb-redirect-spinner{
  width:44px;height:44px;
  border:3px solid rgba(251,246,236,0.25);
  border-top-color:var(--gold);
  border-radius:50%;
  margin:0 auto 22px;
  animation:ldb-spin 0.8s linear infinite;
}
@keyframes ldb-spin{to{transform:rotate(360deg);}}
#ldb-redirect-message{
  font-family:var(--display);
  font-size:1.15rem;
  line-height:1.5;
}
@media (prefers-reduced-motion: reduce){
  .ldb-redirect-spinner{animation:none;border-top-color:rgba(251,246,236,0.25);}
}

/* ---------- WooCommerce Account, Login & Notices — branded styling ---------- */
/*
  Same fix as SL Publishing: WooCommerce's default account/login/notice
  templates render as plain, unstyled browser defaults, clashing with
  the rest of the site's design. This brings My Account, login errors,
  and account forms in line with LDB's visual system.
*/

.woocommerce-error, .woocommerce-message, .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info{
  background:var(--cream-deep) !important;
  color:var(--ink) !important;
  border:1px solid var(--line) !important;
  border-left:4px solid #B23A3A !important;
  border-radius:4px !important;
  padding:16px 20px !important;
  margin-bottom:24px !important;
  list-style:none !important;
}
.woocommerce-message{border-left-color:var(--forest) !important;}
.woocommerce-info{border-left-color:var(--sky) !important;}
.woocommerce-error li, .woocommerce-message li, .woocommerce-info li{
  color:var(--ink) !important;
  list-style:none !important;
  margin:0 !important;
}

.woocommerce-MyAccount-navigation{margin-bottom:32px;}
.woocommerce-MyAccount-navigation ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px;border-bottom:1px solid var(--line);padding-bottom:16px;}
.woocommerce-MyAccount-navigation-link{margin:0;}
.woocommerce-MyAccount-navigation-link a{
  display:inline-block;
  padding:9px 16px;
  font-size:0.82rem;
  font-weight:600;
  color:var(--ink-soft) !important;
  text-decoration:none !important;
  border:1px solid var(--line);
  border-radius:20px;
  transition:.2s ease;
}
.woocommerce-MyAccount-navigation-link a:hover{color:var(--forest-deep) !important;border-color:var(--gold);}
.woocommerce-MyAccount-navigation-link--logout a{color:#B23A3A !important;}
.woocommerce-MyAccount-navigation-link.is-active a{
  background:var(--forest-deep) !important;
  color:var(--cream) !important;
  border-color:var(--forest-deep);
}

.woocommerce-MyAccount-content{color:var(--ink-soft);font-size:0.95rem;line-height:1.75;}
.woocommerce-MyAccount-content p{color:var(--ink-soft) !important;}
.woocommerce-MyAccount-content a{color:var(--forest-deep) !important;text-decoration:underline;}
.woocommerce-MyAccount-content strong{color:var(--ink) !important;}

.woocommerce-form label, .woocommerce form label,
.woocommerce-EditAccountForm label, .woocommerce-ResetPassword label{
  color:var(--ink) !important;
  font-size:0.85rem;
  margin-bottom:6px;
  display:block;
}
.woocommerce-form input[type="text"], .woocommerce-form input[type="email"],
.woocommerce-form input[type="password"], .woocommerce-form input[type="tel"],
.woocommerce form input[type="text"], .woocommerce form input[type="email"],
.woocommerce form input[type="password"], .woocommerce form input[type="tel"],
.woocommerce-EditAccountForm input, .woocommerce-ResetPassword input{
  background:#fff !important;
  color:var(--ink) !important;
  border:1px solid var(--line) !important;
  border-radius:3px !important;
  padding:11px 14px !important;
}
.woocommerce-form input[type="checkbox"]{accent-color:var(--forest-deep);width:16px;height:16px;}

.woocommerce button.button, .woocommerce a.button, .woocommerce input.button,
.woocommerce-form-login-toggle .button, .woocommerce-Button{
  background:var(--forest-deep) !important;
  color:var(--cream) !important;
  border:none !important;
  border-radius:3px !important;
  padding:11px 22px !important;
  font-size:0.8rem !important;
  font-weight:700 !important;
  text-transform:uppercase;
  letter-spacing:0.02em;
  cursor:pointer;
}
.woocommerce button.button:hover, .woocommerce a.button:hover, .woocommerce input.button:hover{
  background:var(--forest) !important;
}

.woocommerce-orders-table, table.shop_table{
  width:100%;
  border-collapse:collapse;
  color:var(--ink-soft);
  font-size:0.85rem;
}
.woocommerce-orders-table th, table.shop_table th{
  color:var(--ink) !important;
  border-bottom:1px solid var(--line);
  padding:10px;
  text-align:left;
}
.woocommerce-orders-table td, table.shop_table td{
  border-bottom:1px solid var(--line);
  padding:10px;
}

/* ---------- Mobile audit fix: WooCommerce orders table ---------- */
/*
  The Account > Orders table (Order, Date, Status, Total, Actions —
  5 columns) had no mobile handling at all and would overflow/squash
  on narrow phones. This makes it horizontally scrollable ONLY below
  700px, leaving the desktop table completely untouched.
*/
@media (max-width:700px){
  .woocommerce-orders-table, table.shop_table{
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    white-space:nowrap;
  }
}
