/*
Theme Name: Wellness Directory
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A clean directory theme for browsing supplements/products by goal category, with a hero banner, category grid, and popular products list. Built as a custom WordPress theme.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: wd
*/

/* -------------------------------------------------
   1. Variables & Reset
------------------------------------------------- */
:root{
  --wd-ink: #0f2a24;
  --wd-teal-dark: #0a2622;
  --wd-teal: #0f5c46;
  --wd-teal-bright: #1a8a68;
  --wd-text-muted: #5b6b67;
  --wd-border: #e7ece9;
  --wd-bg: #f7f8f7;
  --wd-white: #ffffff;
  --wd-radius: 14px;
  --wd-radius-sm: 10px;
  --wd-shadow: 0 1px 2px rgba(15,42,36,0.04), 0 1px 8px rgba(15,42,36,0.05);
  --wd-shadow-hover: 0 6px 20px rgba(15,42,36,0.10);
  --wd-max: 1180px;
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--wd-ink);
  background: var(--wd-white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img{ max-width:100%; display:block; }
a{ color: var(--wd-teal); text-decoration:none; }
a:hover{ color: var(--wd-teal-bright); }
h1,h2,h3{ margin:0; line-height:1.15; }
p{ margin:0; }
ul{ margin:0; padding:0; list-style:none; }
button{ font-family:inherit; }

.wd-container{
  max-width: var(--wd-max);
  margin: 0 auto;
  padding: 0 24px;
}
.screen-reader-text{
  position:absolute !important;
  width:1px;height:1px;
  overflow:hidden;
  clip:rect(1px,1px,1px,1px);
}

/* -------------------------------------------------
   2. Header
------------------------------------------------- */
.wd-site-header{
  border-bottom: 1px solid var(--wd-border);
  background: var(--wd-white);
  position: sticky;
  top:0;
  z-index: 50;
}
.wd-site-header .wd-container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height: 68px;
}
.wd-logo{
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--wd-ink);
  letter-spacing: -0.02em;
}
.wd-logo img{ max-height: 40px; }
.wd-primary-nav ul{ display:flex; align-items:center; gap: 28px; }
.wd-primary-nav a{
  color:#3d4a46;
  font-size:0.92rem;
  font-weight:500;
}
.wd-primary-nav a:hover{ color: var(--wd-ink); }
.wd-nav-toggle{
  display:none;
  background:none;border:none;cursor:pointer;
  font-size:1.4rem;
}

@media (max-width: 720px){
  .wd-primary-nav{ display:none; }
  .wd-nav-toggle{ display:block; }
}

.wd-search-icon{
  width:34px;height:34px;
  border-radius:50%;
  border:none;
  background: transparent;
  color:#3d4a46;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  padding:0;
}
.wd-search-icon:hover{ background: var(--wd-bg); color: var(--wd-ink); }

/* -------------------------------------------------
   3b. Header search overlay + live suggestions
------------------------------------------------- */
body.wd-search-locked{ overflow: hidden; }

.wd-search-overlay{
  display: none;
  background: var(--wd-white);
  border-bottom: 1px solid var(--wd-border);
  box-shadow: 0 8px 24px rgba(15,42,36,0.06);
  position: relative;
  z-index: 40;
}
.wd-search-overlay.wd-open{ display: block; }

.wd-search-overlay-inner{
  max-width: var(--wd-max);
  margin: 0 auto;
  padding: 18px 24px;
  display:flex;
  align-items:center;
  gap: 14px;
}

.wd-search-field-wrap{
  position: relative;
  flex: 1;
}
.wd-search-field-wrap input[type="search"]{
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 13px 44px 13px 18px;
  border-radius: 999px;
  border: 1.5px solid #17233b;
  background: var(--wd-white);
  color: var(--wd-ink);
}
.wd-search-field-wrap input[type="search"]::-webkit-search-cancel-button{ display:none; }
.wd-search-field-wrap input[type="search"]:focus{ outline: none; border-color: var(--wd-teal-bright); }

.wd-search-clear{
  display:none;
  position:absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  align-items:center; justify-content:center;
  border:none; background:none; cursor:pointer;
  color: #17233b;
  padding:0;
}

.wd-search-submit{
  flex: none;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--wd-teal-bright), var(--wd-teal));
  color: #fff;
  display:flex; align-items:center; justify-content:center;
  cursor: pointer;
}
.wd-search-submit:hover{ filter: brightness(1.06); }

.wd-search-results{
  display:none;
  position:absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(360px, 100%);
  background: var(--wd-white);
  border: 1px solid var(--wd-border);
  border-radius: var(--wd-radius-sm);
  box-shadow: var(--wd-shadow-hover);
  overflow: hidden;
  z-index: 45;
}
.wd-search-results.wd-open{ display:block; }

.wd-search-result-row{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--wd-border);
  color: var(--wd-ink);
  font-weight: 600;
  font-size: 0.92rem;
}
.wd-search-result-row:last-child{ border-bottom: none; }
.wd-search-result-row:hover{ background: var(--wd-bg); color: var(--wd-ink); }
.wd-search-result-thumb{
  width:36px;height:36px;
  border-radius:8px;
  background: var(--wd-bg);
  overflow:hidden;
  flex: none;
  display:flex; align-items:center; justify-content:center;
}
.wd-search-result-thumb img{ width:100%;height:100%; object-fit:cover; }

@media (max-width: 560px){
  .wd-search-overlay-inner{ padding: 14px 16px; gap: 10px; }
  .wd-search-submit{ width:42px; height:42px; }
}

/* -------------------------------------------------
   3. Hero
------------------------------------------------- */
.wd-hero{
  background: radial-gradient(120% 160% at 15% 0%, #12463b 0%, var(--wd-teal-dark) 55%, #071c18 100%);
  color: var(--wd-white);
  padding: 72px 0 88px;
}
.wd-eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6fe3b8;
  margin-bottom: 14px;
}
.wd-hero h1{
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 760px;
}
.wd-hero-desc{
  margin-top: 18px;
  max-width: 620px;
  color: #cfe3dc;
  font-size: 1.05rem;
}

/* -------------------------------------------------
   4. Category grid
------------------------------------------------- */
.wd-categories{
  background: var(--wd-bg);
  padding: 46px 0 60px;
  margin-top: -40px;
  scroll-margin-top: 84px;
}
.wd-category-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 980px){
  .wd-category-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .wd-category-grid{ grid-template-columns: 1fr; }
}

.wd-category-card{
  background: var(--wd-white);
  border: 1px solid var(--wd-border);
  border-radius: var(--wd-radius);
  padding: 22px 22px 20px;
  box-shadow: var(--wd-shadow);
  transition: box-shadow .18s ease, transform .18s ease;
  display:flex;
  flex-direction:column;
  gap: 14px;
}
.wd-category-card:hover{
  box-shadow: var(--wd-shadow-hover);
  transform: translateY(-2px);
}
.wd-icon-circle{
  width:48px;height:48px;
  border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  font-size:1.3rem;
}
.wd-category-card h3{
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--wd-ink);
}
.wd-browse-link{
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--wd-teal);
}
.wd-category-card:hover .wd-browse-link{ color: var(--wd-teal-bright); }

/* -------------------------------------------------
   5. Popular products list
------------------------------------------------- */
.wd-popular{ padding: 20px 0 70px; }
.wd-popular h2{
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 18px;
}
.wd-product-list{
  border: 1px solid var(--wd-border);
  border-radius: var(--wd-radius);
  overflow: hidden;
}
.wd-product-row{
  display:flex;
  align-items:center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--wd-border);
  color: var(--wd-ink);
  font-weight: 600;
  font-size: 0.98rem;
}
.wd-product-row:last-child{ border-bottom: none; }
.wd-product-row:hover{ background: var(--wd-bg); color: var(--wd-ink); }
.wd-product-thumb{
  width:44px;height:44px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--wd-bg);
  flex: none;
  display:flex;align-items:center;justify-content:center;
}
.wd-product-thumb img{ width:100%; height:100%; object-fit: cover; }
.wd-thumb-placeholder{
  width:100%;height:100%;
  background: linear-gradient(135deg,#e7ece9,#f4f6f5);
  display:block;
}

/* -------------------------------------------------
   6. Category (taxonomy) archive
------------------------------------------------- */
.wd-breadcrumb{
  font-size: 0.85rem;
  color: var(--wd-text-muted);
  margin-bottom: 14px;
}
.wd-breadcrumb a{ color: var(--wd-teal); font-weight: 500; }
.wd-breadcrumb .sep{ margin: 0 6px; color:#a9b5b1; }
.wd-breadcrumb .current{ color: var(--wd-ink); }

.wd-archive-header{
  background: var(--wd-bg);
  padding: 34px 0 26px;
  border-bottom: 1px solid var(--wd-border);
}
.wd-archive-header-row{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.wd-archive-header .wd-icon-circle{ font-size:1.4rem; width:44px; height:44px; border-radius:12px; margin-bottom: 12px; }
.wd-archive-header h1{ font-size: 1.7rem; font-weight:800; }
.wd-archive-count{ margin-top:6px; color: var(--wd-text-muted); font-size:0.92rem; }
.wd-archive-header p.wd-term-desc{ margin-top:8px; color: var(--wd-text-muted); max-width:640px; }

.wd-header-search{ display:flex; gap:10px; }
.wd-header-search input[type="search"]{
  border: 1px solid var(--wd-border);
  background: var(--wd-white);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  min-width: 220px;
  font-family: inherit;
}
.wd-header-search input[type="search"]:focus{ outline: 2px solid var(--wd-teal-bright); outline-offset: 1px; }
.wd-header-search button{
  background: linear-gradient(135deg, var(--wd-teal-bright), var(--wd-teal));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.wd-header-search button:hover{ filter: brightness(1.06); }

.wd-archive-grid{
  padding: 32px 0 70px;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 20px;
}
@media (max-width: 1040px){ .wd-archive-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px){ .wd-archive-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px){ .wd-archive-grid{ grid-template-columns: 1fr; } }

.wd-product-card{
  border:1px solid var(--wd-border);
  border-radius: var(--wd-radius);
  overflow:hidden;
  background: var(--wd-white);
  box-shadow: var(--wd-shadow);
  transition: box-shadow .18s ease, transform .18s ease;
  display:block;
}
.wd-product-card:hover{ box-shadow: var(--wd-shadow-hover); transform: translateY(-2px); }
.wd-product-card .wd-product-card-img{
  position: relative;
  aspect-ratio: 1/1;
  background: var(--wd-bg);
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
}
.wd-product-card .wd-product-card-img img{ width:100%;height:100%; object-fit:cover; }
.wd-view-badge{
  position:absolute;
  top:10px; right:10px;
  background: rgba(255,255,255,0.92);
  color: var(--wd-ink);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.wd-product-card-body{ display:block; padding: 14px 16px 18px; }
.wd-product-card-body h3{ font-size:1rem; font-weight:700; color:var(--wd-ink); margin-bottom: 6px; }
.wd-product-card-body p, .wd-card-excerpt{ display:block; margin-top:6px; margin-bottom:12px; font-size:0.86rem; color: var(--wd-text-muted); }
.wd-go-to-product{
  display:block;
  text-align:center;
  background: linear-gradient(135deg, var(--wd-teal-bright), var(--wd-teal));
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 11px 16px;
  border-radius: 9px;
  margin-top: 10px;
}
.wd-go-to-product:hover{ filter: brightness(1.06); color:#fff !important; }

/* Simple "All Products" header variant (no icon/count/right-aligned search) */
.wd-archive-header--simple h1{ font-size: 1.6rem; font-weight:800; }

.wd-inline-search{
  margin-top: 18px;
  display:flex;
  gap:10px;
  max-width: 520px;
}
.wd-inline-search input[type="search"]{
  flex:1;
  border:1px solid var(--wd-border);
  border-radius:8px;
  padding:10px 14px;
  font-size:0.92rem;
  font-family:inherit;
  background:var(--wd-white);
}
.wd-inline-search input[type="search"]:focus{ outline:2px solid var(--wd-teal-bright); outline-offset:1px; }
.wd-inline-search button{
  background: linear-gradient(135deg, var(--wd-teal-bright), var(--wd-teal));
  color:#fff;border:none;border-radius:8px;padding:10px 22px;font-weight:700;font-size:0.92rem;cursor:pointer;
  white-space: nowrap;
}
.wd-inline-search button:hover{ filter:brightness(1.06); }

/* Simple product card: image, title, category tags — no badge/button */
.wd-simple-card{
  display:block;
  border:1px solid var(--wd-border);
  border-radius: var(--wd-radius);
  overflow:hidden;
  background: var(--wd-white);
  box-shadow: var(--wd-shadow);
  transition: box-shadow .18s ease, transform .18s ease;
  color: inherit;
}
.wd-simple-card:hover{ box-shadow: var(--wd-shadow-hover); transform: translateY(-2px); color: inherit; }
.wd-simple-card .wd-product-card-img{
  aspect-ratio: 4/3;
  background: var(--wd-bg);
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
}
.wd-simple-card .wd-product-card-img img{ width:100%;height:100%; object-fit:cover; }
.wd-simple-card-body{ display:block; padding: 14px 16px 18px; }
.wd-simple-card-body h3{ font-size:1rem; font-weight:700; color:var(--wd-ink); margin-bottom:4px; }
.wd-simple-card-terms{ display:block; font-size:0.85rem; color: var(--wd-text-muted); }

/* Numbered pagination */
.wd-pagination{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  flex-wrap: wrap;
  padding: 14px 0 64px;
}
.wd-pagination .page-numbers{
  min-width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  border-radius:50%;
  border:1px solid var(--wd-border);
  color: var(--wd-ink);
  font-weight:600;
  font-size:0.88rem;
  background: var(--wd-white);
  padding: 0 6px;
}
a.page-numbers:hover{ border-color: var(--wd-teal-bright); color: var(--wd-teal-bright); }
.wd-pagination .page-numbers.current{
  background: linear-gradient(135deg, var(--wd-teal-bright), var(--wd-teal));
  color:#fff;
  border-color: transparent;
}
.wd-pagination .page-numbers.dots{ border:none; background:none; }

/* -------------------------------------------------
   7. Single product
------------------------------------------------- */
.wd-single-product{ padding: 50px 0 70px; }
.wd-single-product .wd-back-link{ font-size:0.88rem; font-weight:600; margin-bottom:22px; display:inline-block; }
.wd-single-grid{ display:grid; grid-template-columns: 340px 1fr; gap: 42px; }
@media (max-width: 780px){ .wd-single-grid{ grid-template-columns: 1fr; } }
.wd-single-grid .wd-product-card-img{ border-radius: var(--wd-radius); overflow:hidden; border:1px solid var(--wd-border); aspect-ratio:1/1; background:var(--wd-bg); }
.wd-single-title{ font-size: 2rem; font-weight:800; margin-bottom: 14px; }
.wd-single-terms{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom: 18px; }
.wd-single-terms a{
  font-size:0.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em;
  background: var(--wd-bg); border:1px solid var(--wd-border); padding: 5px 10px; border-radius: 999px; color: var(--wd-teal);
}
.wd-single-content{ color:#33413d; font-size:1rem; }
.wd-single-content p{ margin-bottom: 14px; }

/* -------------------------------------------------
   8. Generic page / 404
------------------------------------------------- */
.wd-page{ padding: 56px 0 80px; }
.wd-page h1{ font-size:2rem; font-weight:800; margin-bottom:20px; }
.wd-page-content{ max-width: 760px; color:#33413d; }
.wd-page-content p{ margin-bottom:14px; }

/* -------------------------------------------------
   9. Footer
------------------------------------------------- */
.wd-site-footer{
  border-top: 1px solid var(--wd-border);
  background: var(--wd-white);
}
.wd-footer-links{
  padding: 26px 0;
  display:flex; gap:26px; flex-wrap:wrap;
  border-bottom: 1px solid var(--wd-border);
}
.wd-footer-links a{ font-size:0.9rem; color:#3d4a46; font-weight:500; }
.wd-footer-bottom{
  padding: 22px 0 34px;
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px;
}
.wd-footer-brand{ font-weight:800; font-size:0.95rem; color:var(--wd-ink); }
.wd-footer-tagline{ color: var(--wd-text-muted); font-size:0.85rem; margin-top:4px; }
.wd-footer-copy{ color: var(--wd-text-muted); font-size:0.85rem; }
