/*
 * shop.css — Custom CSS additions for GreenShop
 * Supplements style.css with components added in the 2026 UX improvement pass.
 */

/* ── CSS Variables (fallback if style.css does not define them) ─────────── */
:root {
  --green-dark:   #1b4332;
  --green-mid:    #2d6a4f;
  --green-light:  #3a9d6e;
  --green-pale:   #d8f3dc;
  --transition:   .2s ease;
}

/* ── Skip-to-content link ───────────────────────────────────────────────── */
.skip-link,
.visually-hidden-focusable.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 99999;
  padding: 10px 18px;
  background: var(--green-dark);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus,
.visually-hidden-focusable.skip-link:focus {
  top: 0;
}

/* ── News ticker ────────────────────────────────────────────────────────── */
.news-ticker {
  background: var(--green-dark);
  color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  height: 36px;
  position: relative;
  z-index: 100;
}
.news-ticker-inner {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  will-change: transform;
}
.news-ticker-inner:hover {
  animation-play-state: paused;
}
@keyframes ticker-scroll {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}
.news-ticker-item {
  display: inline-block;
  padding: 0 2rem;
  font-size: .82rem;
  border-right: 1px solid rgba(255,255,255,.2);
}

/* ── Hamburger button (CSS-only animation) ──────────────────────────────── */
.hamburger-btn {
  border: none;
  background: none;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  width: 38px;
  align-items: center;
}
.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: transform .25s, opacity .25s, width .25s;
  transform-origin: center;
}
/* When the Bootstrap collapse is open, aria-expanded="true" is set */
.hamburger-btn[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.hamburger-btn[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Sticky Add-to-Cart bar ─────────────────────────────────────────────── */
.sticky-add-to-cart {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  background: #fff;
  border-top: 2px solid var(--green-light);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .12);
  padding: 10px 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform .3s ease;
  pointer-events: none;
}
.sticky-add-to-cart.sticky-atc-visible {
  transform: translateY(0);
  pointer-events: auto;
}
.sticky-product-name {
  max-width: 260px;
  font-size: .95rem;
  color: var(--green-dark);
}
@media (max-width: 576px) {
  .sticky-product-name { display: none; }
  .sticky-add-to-cart .container { gap: .5rem; }
}
@media (max-width: 991.98px) {
  .sticky-add-to-cart { bottom: 56px; } /* above the bottom-nav */
}

/* ── Trust badges (footer row) ──────────────────────────────────────────── */
.trust-badges-row {
  border-bottom-color: rgba(255, 255, 255, .15) !important;
}
.trust-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.trust-badge-icon {
  font-size: 1.5rem;
  line-height: 1;
  color: #f0d080;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 2px solid rgba(240,208,128,.3);
  transition: transform .2s, border-color .2s;
}
.trust-badge-item:hover .trust-badge-icon {
  transform: scale(1.1);
  border-color: rgba(240,208,128,.6);
}
.trust-badge-label {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

/* ── Payment method badges ──────────────────────────────────────────────── */
.payment-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .8rem;
  color: rgba(255, 255, 255, .75);
  white-space: nowrap;
}

/* ── Star ratings ───────────────────────────────────────────────────────── */
.star-rating {
  color: #ffc107;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.star-rating .rating-value {
  color: #333;
  font-size: .9rem;
}

/* ── Hero trust icons (homepage hero section) ───────────────────────────── */
.hero-trust-icons { margin-top: 28px; }
.hero-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.95);
}
.hero-trust-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #f0d080;
  transition: background .2s, transform .2s;
}
.hero-trust-item:hover .hero-trust-icon {
  background: rgba(255,255,255,.2);
  transform: translateY(-2px);
}
.hero-trust-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .85;
}

/* Hero trust inline (compact row) */
.hero-trust-inline {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  letter-spacing: .02em;
}
.hero-trust-inline i {
  font-size: 1rem;
  color: #f0d080;
}
.hero-trust-sep {
  color: rgba(255,255,255,.4);
  font-size: 1.1rem;
}

/* Hide arcade game button */
#hero-game-btn { display: none !important; }

/* ── Exit-intent overlay (base; detailed styles are inline in exit_intent.php) */
.exit-intent-overlay {
  z-index: 19990;
}

/* ── Cookie consent banner ──────────────────────────────────────────────── */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9980;
  background: rgba(27, 67, 50, .97);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,.12);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cookie-consent-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-consent-text {
  font-size: .88rem;
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}
.cookie-consent-btns {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}
.cookie-consent-btns .btn-success,
.cookie-consent-btns .btn:last-child {
  background: var(--green-light);
  border-color: var(--green-light);
  color: #fff;
  font-weight: 700;
  padding: .5rem 1.6rem;
  border-radius: 8px;
}
.cookie-consent-btns .btn-outline-light,
.cookie-consent-btns .btn:first-child {
  background: transparent;
  border: 1px solid rgba(255,255,255,.4);
  color: rgba(255,255,255,.8);
  padding: .5rem 1.2rem;
  border-radius: 8px;
}
@media (max-width: 480px) {
  .cookie-consent-inner { flex-direction: column; align-items: flex-start; }
  .cookie-consent-btns  { width: 100%; }
  .cookie-consent-btns .btn { flex: 1; }
}

/* ── Free-shipping progress bar (cart page) ─────────────────────────────── */
.shipping-progress {
  border-left: 4px solid var(--green-light);
}
.shipping-progress .progress {
  border-radius: 4px;
  background: #e9ecef;
}
.shipping-progress .progress-bar {
  border-radius: 4px;
  transition: width .6s ease;
}

/* ── Mobile improvements ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Tighter product grid on small phones */
  .row-cols-2 > .col { padding: 6px; }
  .product-card .card-body { padding: .5rem; }
  .product-name { font-size: .78rem; }
  .price-gross  { font-size: .88rem; }

  /* Full-width sticky bar on mobile */
  .sticky-add-to-cart { padding: 8px 0; }

  /* Breadcrumb ellipsis */
  .breadcrumb-item { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Checkout form */
  .checkout-summary { position: static !important; }

  /* Footer newsletter stacked */
  #footer-newsletter-form { flex-direction: column; }
  #footer-newsletter-form .btn { width: 100%; }
}

@media (max-width: 480px) {
  .trust-badge-label { display: none; }
  .trust-badge-item  { flex-direction: row; gap: 6px; }
}

/* ── Mobile Bottom Navigation ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1039;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
  transition: transform .3s ease;
}
.bottom-nav.bottom-nav-hidden {
  transform: translateY(100%);
  pointer-events: none;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #666;
  font-size: .65rem;
  gap: 2px;
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  min-height: 44px;
  justify-content: center;
}
.bottom-nav-item i { font-size: 1.25rem; }
.bottom-nav-item:hover,
.bottom-nav-item:active { color: var(--green-mid); text-decoration: none; }
.bottom-nav-item.active { color: var(--green-dark); font-weight: 700; }
.bottom-nav-item.active i { color: var(--green-mid); }

@media (max-width: 991.98px) {
  body { padding-bottom: 64px; }
}

@media print {
  .bottom-nav { display: none !important; }
}

/* ── AJAX Filter Loading ───────────────────────────────────────────────── */
.grid-loading-spinner {
  display: none;
  justify-content: center;
  padding: 40px 0;
}

/* ── Print styles (invoice / order confirmation) ────────────────────────── */
@media print {
  nav,
  footer,
  .navbar,
  .sticky-add-to-cart,
  .cookie-consent,
  .exit-intent-overlay,
  #chat-bubble,
  #chat-window,
  .gs-news-ticker,
  .no-print {
    display: none !important;
  }
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
  a { color: #000; text-decoration: none; }
  .container { max-width: 100% !important; padding: 0 !important; }
}

.search-bar { position: relative; }
