/*
Theme Name: PureBud Shop
Theme URI: https://purebud.store
Author: PureBud
Description: Clean WooCommerce Theme for PureBud — Modern Smooth UI.
Version: 1.1.1
Text Domain: purebud-shop
*/

/* =========================================================
   0. GLOBAL RESETS / TOKENS
   ========================================================= */

/* Basic element reset */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
}
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Design tokens */
:root {
  --pb-green: #1F7A3A;
  --pb-green-2: #26A64B;
  --pb-lime: #A6E22E;
  --pb-dark: #111312;
  --pb-muted: #8D9299;
  --pb-bg: #F8F9F8;
  --pb-white: #FFFFFF;
  --pb-border: #E3E5E7;

  --pb-radius: 12px;
  --pb-radius-lg: 20px;

  --pb-shadow: 0 8px 24px rgba(0,0,0,.06);
  --pb-shadow-lg: 0 14px 40px rgba(0,0,0,.10);

  --pb-gap: clamp(16px,2vw,28px);
  --pb-max: 1200px;

  --pb-ease: cubic-bezier(.25,.1,.25,1);
  --pb-tr: all .25s var(--pb-ease);
}

/* Typography / base */
body {
  color: var(--pb-dark);
  background: var(--pb-bg);
  font: 16px/1.6 "Inter","Poppins",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3,
h4 {
  margin: 0 0 .6em;
  line-height: 1.2;
  letter-spacing: -.01em;
  font-family: "Sora","Poppins","Inter",sans-serif;
  font-weight: 700;
  color: var(--pb-dark);
}
p {
  margin: 0 0 1em;
}
a {
  color: var(--pb-green);
  text-decoration: none;
  transition: var(--pb-tr);
}
a:hover {
  color: var(--pb-lime);
}
:focus-visible {
  outline: 3px solid var(--pb-lime);
  outline-offset: 3px;
}

/* Screen reader utility */
.screen-reader-text {
  position: absolute;
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  white-space: nowrap;
}

/* Layout helpers */
.container,
.pb-container {
  max-width: var(--pb-max);
  margin: 0 auto;
  padding: 0 var(--pb-gap);
}
.section {
  padding: clamp(40px,6vw,100px) 0;
}
.section--card {
  background: var(--pb-white);
  border-radius: var(--pb-radius);
  box-shadow: var(--pb-shadow);
}

/* WP align helpers */
.alignwide {
  max-width: var(--pb-max);
  margin-left: auto;
  margin-right: auto;
}
.alignfull {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================================
   1. HEADER / NAVIGATION
   ========================================================= */

/* Sticky Header bar */
.pb-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0,0,0,.05);
}

/* Fallback: no backdrop-filter support */
@supports not ((backdrop-filter: blur(1px))) {
  .pb-header {
    background: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.06);
  }
}

/* Header inner layout */
.pb-header .pb-header-inner {
  max-width: var(--pb-max);
  margin: 0 auto;
  padding: .9rem var(--pb-gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo area */
.pb-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.pb-logo .site-title {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--pb-green);
}
.pb-logo img.custom-logo {
  max-height: 56px;
  height: auto;
  width: auto;
}

/* Desktop nav (center) */
.pb-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}
.pb-nav .pb-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.pb-nav .pb-menu > li {
  position: relative;
}
.pb-nav .pb-menu a {
  color: var(--pb-dark);
  font-weight: 600;
  padding: .35rem 0;
  display: inline-block;
  position: relative;
}
.pb-nav .pb-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 0;
  background: var(--pb-green);
  transition: width .25s ease;
}
.pb-nav .pb-menu a:hover::after,
.pb-nav .pb-menu a[aria-current="page"]::after {
  width: 100%;
}

/* Header actions (cart, burger) */
.pb-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Cart link & badge */
.pb-cart {
  position: relative;
  text-decoration: none;
  color: #0f1a12;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.pb-cart .icon {
  font-size: 1.15rem;
  line-height: 1;
}
.pb-cart .count {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 1.2rem;
  height: auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--pb-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  line-height: 1;
  font-weight: 800;
  text-align: center;
}

/* Burger button (mobile menu toggle) */
.pb-toggle {
  background: transparent;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  color: #0f1a12;
}

/* Desktop vs mobile visibility in header */
@media (max-width: 980px) {
  .pb-nav {
    display: none;
  }
  .pb-toggle {
    display: inline-flex;
  }
}
@media (min-width: 981px) {
  .pb-toggle {
    display: none;
  }
}

/* =========================================================
   2. MOBILE OFF-CANVAS NAV
   ========================================================= */

/* Overlay behind the drawer */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.menu-overlay[hidden] {
  display: none !important;
}
.menu-overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

/* Block scroll on body while open */
body.menu-open,
body.no-scroll,
body.pb-nav-open {
  overflow: hidden;
}

/* Drawer nav */
.pb-mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(86vw, 380px);
  max-width: 90%;
  height: 100vh;
  background: var(--pb-white);
  box-shadow: var(--pb-shadow-lg);
  z-index: 9999;

  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;

  transform: translateX(100%);
  transition: transform .28s var(--pb-ease);
}
.pb-mobile-nav[hidden] {
  display: none !important;
}
.pb-mobile-nav:not([hidden]) {
  transform: translateX(0);
}

/* Close button inside drawer */
.pb-mobile-nav .pb-close {
  align-self: flex-end;
  background: transparent;
  border: 0;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: #111;
  padding: 8px;
}

/* List in drawer */
.pb-mobile-nav .pb-menu,
.pb-mobile-nav .pb-menu-mobile {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.pb-mobile-nav .pb-menu li {
  border-bottom: 1px solid rgba(0,0,0,.07);
  margin: 0;
}
.pb-mobile-nav .pb-menu a {
  display: block;
  padding: .8rem .4rem;
  border-radius: 10px;
  color: var(--pb-dark);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  word-break: break-word;
}
.pb-mobile-nav .pb-menu a:hover,
.pb-mobile-nav .pb-menu a:active {
  background: #f3f5f4;
  color: var(--pb-green);
}

/* Desktop hides mobile drawer elements */
@media (min-width:768px) {
  .pb-nav { display: block; }
  .pb-toggle { display: none; }
  .pb-mobile-nav {
    display: none !important;
  }
  .menu-overlay {
    display: none !important;
  }
}

/* Mobile hides desktop nav */
@media (max-width:767px) {
  .pb-nav {
    display: none;
  }
  .pb-header .pb-actions {
    margin-left: auto;
  }
}

/* Submenu dropdown for desktop nav */
.menu-item-has-children.is-open > .sub-menu {
  display: block !important;
}
.pb-nav .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 200px;
  background: var(--pb-white);
  border: 1px solid var(--pb-border);
  border-radius: 12px;
  box-shadow: var(--pb-shadow);
  padding: .5rem;
}
.pb-nav .sub-menu li a {
  display: block;
  padding: .55rem .75rem;
  border-radius: 8px;
}
.pb-nav .sub-menu li a:hover {
  background: #f4f6f5;
}

/* Motion reduction */
@media (prefers-reduced-motion: reduce) {
  .pb-mobile-nav {
    transition: none;
  }
  .menu-overlay {
    transition: none;
  }
}

/* =========================================================
   3. BUTTONS (primary, ghost, WC etc.)
   ========================================================= */

.btn,
.button,
.wp-block-button__link,
.form-submit,
.woocommerce a.button,
.woocommerce button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;

  padding: 12px 22px;
  border: none;
  border-radius: var(--pb-radius);

  font-weight: 700;
  color: #fff;
  cursor: pointer;

  background: linear-gradient(135deg,var(--pb-green),var(--pb-green-2));
  box-shadow: 0 8px 24px rgba(31,122,58,.20);

  transition:
    transform .2s var(--pb-ease),
    box-shadow .2s var(--pb-ease),
    filter .2s var(--pb-ease);
}
.btn:hover,
.button:hover,
.wp-block-button__link:hover,
.form-submit:hover,
.woocommerce a.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--pb-shadow-lg);
  filter: saturate(1.05);
}
.btn--ghost {
  background: transparent;
  color: var(--pb-green);
  border: 2px solid var(--pb-green);
  box-shadow: none;
}
.btn--ghost:hover {
  color: var(--pb-white);
  background: var(--pb-green);
}

/* =========================================================
   4. HERO BLOCKS
   ========================================================= */

.hero {
  background: var(--pb-white);
  border-radius: var(--pb-radius-lg);
  box-shadow: var(--pb-shadow);

  text-align: center;

  padding: clamp(40px,6vw,90px);
  margin-top: clamp(8px,1vw,16px);

  animation: pb-fade .6s ease both;
}
.hero h1 {
  font-size: clamp(2rem,4.8vw,3.4rem);
}
.hero p {
  color: var(--pb-muted);
  font-size: 1.075rem;
  max-width: 720px;
  margin: 0 auto 1.8rem;
}

/* Fade anim */
@keyframes pb-fade {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* =========================================================
   5. FEATURE CARDS (generic info cards / USP grids)
   ========================================================= */

.features {
  display: grid;
  gap: var(--pb-gap);
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  margin: 2.2rem 0;
}
.feature-card {
  background: var(--pb-white);
  border-radius: var(--pb-radius);
  box-shadow: var(--pb-shadow);
  padding: clamp(16px,3vw,24px);
  text-align: center;
  transition:
    transform .25s var(--pb-ease),
    box-shadow .25s var(--pb-ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pb-shadow-lg);
}
.feature-card h3 {
  color: var(--pb-green);
  margin-bottom: .6rem;
}

/* =========================================================
   6. FORMS (generic + WC + CF7)
   ========================================================= */

label {
  display: block;
  margin: 0 0 .45rem;
  font-weight: 700;
}
input[type=text],
input[type=email],
input[type=tel],
input[type=search],
input[type=number],
input[type=password],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  background: var(--pb-white);
  font-size: .98rem;
  transition: var(--pb-tr);
}
textarea {
  min-height: 120px;
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--pb-green);
  box-shadow: 0 0 0 4px rgba(31,122,58,.15);
}

/* =========================================================
   7. PRODUCT GRID / CARDS (WooCommerce loop on homepage)
   ========================================================= */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
  gap: 24px;
}

/* Karte */
.products-grid .product-card {
  background:#fff;
  border:1px solid rgba(0,0,0,.05);
  border-radius:16px;
  box-shadow:0 16px 40px rgba(0,0,0,.06);
  padding:16px;
  text-align:center;
  display:flex;
  flex-direction:column;
  transition:all .25s var(--pb-ease);
}
.products-grid .product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Bildbereich (eigener Block) */
.products-grid .product-card .product-image {
  position:relative;
  width:100%;
  border-radius:12px;
  overflow:hidden;
  background:#f8f8f8;
  box-shadow:0 8px 24px rgba(0,0,0,.05);
  aspect-ratio:4/3;
  margin-bottom:12px;
  display:block;
}
.products-grid .product-card .product-image img {
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  display:block;
}

/* Titel */
.products-grid .product-card .product-title,
.products-grid .product-card h3.product-title {
  font-size:1rem;
  font-weight:600;
  line-height:1.4;
  color:#0f1a12;
  margin:0 0 8px;
  text-align:center;
  min-height:auto;
}

/* Preis */
.products-grid .product-card .price,
.products-grid .product-card p.price {
  margin:0 0 8px;
  font-size:1rem;
  font-weight:600;
  line-height:1.4;
  color:#1f7a3a;
  text-align:center;
}

/* Versand-/Zusatztext (wenn Woo was ausgibt) */
.products-grid .product-card .woocommerce-shipping-txt,
.products-grid .product-card .woocommerce-loop-product__shipping,
.products-grid .product-card .woocommerce-Price-suffix,
.products-grid .product-card .amount + span,
.products-grid .product-card .shipping {
  display:block;
  font-size:.8rem;
  line-height:1.3;
  color:#2f422f;
  margin:0 0 12px;
  text-align:center;
}

/* CTA-Wrapper: hält den Button unten */
.products-grid .product-card .product-cta {
  margin-top:auto;
  display:block;
}

/* Button selbst */
.products-grid .product-card .button,
.products-grid .product-card .add_to_cart_button,
.products-grid .product-card button,
.products-grid .product-card form.cart .button {
  width:100%;
  max-width:100%;
  border-radius:8px;
  padding:10px 16px !important;
  font-size:.8rem;
  font-weight:600;
  line-height:1.2;
  background:linear-gradient(135deg,#1f7a3a,#16a34a) !important;
  color:#fff !important;
  border:0 !important;
  text-decoration:none;
  text-align:center;
  box-shadow:
    0 10px 24px rgba(0,0,0,.12),
    0 0 0 3px rgba(22,163,74,.18);
  transition:background .2s ease,filter .2s ease;
}
.products-grid .product-card .button:hover,
.products-grid .product-card .add_to_cart_button:hover,
.products-grid .product-card button:hover,
.products-grid .product-card form.cart .button:hover {
  filter:brightness(1.05);
  background:#16612d !important;
}

/* Desktop-Feintuning */
@media (min-width:769px){
  .products-grid {
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:var(--pb-gap,24px);
  }

  .products-grid .product-card .product-image {
    aspect-ratio:4/3;
    height:auto;
    max-height:none;
  }

  .products-grid .product-card .product-image img {
    object-fit:cover;
    object-position:center;
  }
}

/* Mobile:
   - 2 Spalten
   - Quadratisches Bild
   - Max 4 Produkte anzeigen
   - Weniger Luft zwischen Elementen
*/
@media (max-width:768px){

  /* Max 4 Produkte */
  .products-grid .product-card:nth-child(n+5){
    display:none !important;
  }

  .products-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:var(--pb-gap,16px);
  }

  .products-grid .product-card {
    border:1px solid rgba(0,0,0,.06);
    border-radius:14px;
    box-shadow:0 12px 32px rgba(0,0,0,.06);
    padding:12px 12px 16px;
    justify-content:flex-start;
  }

  /* Quadratischer Image-Slot */
  .products-grid .product-card .product-image {
    aspect-ratio:1/1;
    margin-bottom:10px;
  }
  .products-grid .product-card .product-image img {
    aspect-ratio:1/1;
    object-fit:cover;
    object-position:center;
  }

  /* Titel dichter */
  .products-grid .product-card .product-title,
  .products-grid .product-card h3.product-title {
    font-size:.9rem;
    font-weight:600;
    line-height:1.4;
    margin:10px 0 4px !important;
    min-height:2.6em;
    text-align:center;
  }

  /* Preis nah am Titel */
  .products-grid .product-card .price,
  .products-grid .product-card p.price {
    margin:4px 0 4px !important;
    font-size:.9rem;
    font-weight:600;
    line-height:1.3;
    color:#1f7a3a;
    text-align:center;
  }

  /* Versandtext kompakt */
  .products-grid .product-card .woocommerce-shipping-txt,
  .products-grid .product-card .woocommerce-loop-product__shipping,
  .products-grid .product-card .woocommerce-Price-suffix,
  .products-grid .product-card .amount + span,
  .products-grid .product-card .shipping {
    margin-top:2px !important;
    margin-bottom:6px !important;
    font-size:.8rem;
    line-height:1.3;
    text-align:center;
  }

  /* Button direkt drunter, kein Abstand */
  .products-grid .product-card .button,
  .products-grid .product-card .add_to_cart_button,
  .products-grid .product-card button,
  .products-grid .product-card form.cart .button {
    margin-top:0 !important;
    padding:10px 12px !important;
    font-size:.8rem;
    line-height:1.2;
    border-radius:10px;
  }

  /* Falls Woo nach dem Button noch ein <p> ausgibt */
  .products-grid .product-card .button + p,
  .products-grid .product-card .add_to_cart_button + p {
    margin-top:6px !important;
    margin-bottom:0 !important;
  }

  /* Alle Kinder enger stapeln */
  .products-grid .product-card > * {
    margin-bottom:6px !important;
  }
  .products-grid .product-card > *:last-child {
    margin-bottom:0 !important;
  }
}

/* WooCommerce price global fallback */
.woocommerce .price {
  color: var(--pb-green);
  font-weight: 800;
}

/* =========================================================
   8. FOOTER
   ========================================================= */

.site-footer,
footer {
  background: var(--pb-dark);
  color: #E7ECEF;
  padding: 60px 0;
  margin-top: clamp(40px,6vw,80px);
}

/* Footer columns: responsive grid */
.footer-columns {
  display: grid;
  gap: var(--pb-gap);
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  align-items: flex-start;
  margin-bottom: var(--pb-gap);
}

/* Footer menus / lists */
.site-footer .menu,
.footer-menu .menu,
.footer-help-list,
.trust-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer .menu,
.footer-menu .menu,
.footer-help-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.trust-list {
  margin-top: .5rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.site-footer p {
  opacity: .9;
  font-size: .9rem;
}
.footer-logo img {
  max-height: 48px;
  width: auto;
}

/* Footer links */
.site-footer a {
  color: #E7ECEF;
  opacity: .85;
  transition: var(--pb-tr);
}
.site-footer a:hover {
  opacity: 1;
  color: var(--pb-lime);
}
.site-footer a:focus-visible {
  outline: 3px solid var(--pb-lime);
  outline-offset: 3px;
}

/* Legal row */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.footer-legal .copyright {
  margin: 0;
  font-size: .85rem;
  color: #E7ECEF;
  opacity: .8;
}
.footer-legal .legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Mobile stacking for footer legal row */
@media (max-width:768px) {
  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
  }
}

/* =========================================================
   9. SCROLL TO TOP BUTTON
   ========================================================= */

#scrollTopBtn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;

  background: #0f1a12;
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 48px;
  height: 48px;
  padding: 0;

  box-shadow: 0 20px 40px rgba(0,0,0,.4);

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity .2s ease, transform .2s ease;
}
#scrollTopBtn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#scrollTopBtn:hover {
  filter: brightness(1.1);
}

/* hide scrollTopBtn completely on desktop */
@media (min-width:768px) {
  #scrollTopBtn {
    display: none;
  }
}
