/*
Theme Name:   Tradefix Handelsonderneming
Theme URI:    https://tradefix.nl
Description:  Astra child theme voor Tradefix Handelsonderneming (hoofdwinkel met premium USP-balk + sale-badge).
Author:       Tradefix
Template:     astra
Version:      1.0.0
*/

/* ============================================
   0. BASIS / GLOBAL
   ============================================ */

body.tradefix-handelsonderneming {
  background-color: #f5f7fb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
}

body.tradefix-handelsonderneming a {
  color: #0f172a;
  text-decoration: none;
}
body.tradefix-handelsonderneming a:hover {
  color: #f97316;
}

.tf-text-muted { color: #6b7280; font-size: 12px; }
.tf-text-quiet { color: #9ca3af; font-size: 12px; }

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

body.tradefix-handelsonderneming.admin-bar { padding-top: 108px; }
body.tradefix-handelsonderneming:not(.admin-bar) { padding-top: 78px; }

body.tradefix-handelsonderneming .site-header,
body.tradefix-handelsonderneming .main-header-bar,
body.tradefix-handelsonderneming .ast-primary-header-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 99999;
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(15,23,42,0.06);
}

body.tradefix-handelsonderneming .site-header .ast-container,
body.tradefix-handelsonderneming .main-header-bar .ast-container,
body.tradefix-handelsonderneming .ast-primary-header-bar {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 16px !important;
}

body.tradefix-handelsonderneming .ast-primary-header-bar {
  min-height: 78px;
  display: flex;
  align-items: center;
}

/* Menu */
body.tradefix-handelsonderneming .main-header-menu > .menu-item > a {
  position: relative;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
}
body.tradefix-handelsonderneming .main-header-menu > .menu-item > a:hover {
  color: #f97316;
}

/* Oranje underline */
body.tradefix-handelsonderneming .main-header-menu > .menu-item > a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -6px;
  height: 2px;
  background: #f97316;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.18s ease-out;
}
body.tradefix-handelsonderneming .main-header-menu > .menu-item:hover > a::after,
body.tradefix-handelsonderneming .main-header-menu > .menu-item.current-menu-item > a::after {
  transform: scaleX(1);
}

/* Zoekveld (FiboSearch) */
body.tradefix-handelsonderneming .dgwt-wcas-search-input {
  width: 100%;
  padding: 8px 40px 8px 14px !important;
  border-radius: 999px !important;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 14px;
  color: #111827;
  box-shadow: 0 4px 12px rgba(15,23,42,0.06);
  transition: all 0.16s ease;
}
body.tradefix-handelsonderneming .dgwt-wcas-search-input::placeholder {
  color: #9ca3af;
}
body.tradefix-handelsonderneming .dgwt-wcas-search-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 2px rgba(249,115,22,0.18);
}

/* Cart badge */
body.tradefix-handelsonderneming .ast-site-header-cart-li .count {
  background: #f97316;
  color: #ffffff;
}

/* ============================================
   2. FOOTER
   ============================================ */

body.tradefix-handelsonderneming .site-footer {
  background: #0f172a !important;
  padding: 40px 0;
  border-top: 1px solid rgba(148,163,184,0.25);
}

body.tradefix-handelsonderneming .site-footer a {
  color: #e5e7eb;
}
body.tradefix-handelsonderneming .site-footer a:hover {
  color: #f97316;
}

/* ============================================
   3. USP-BALK — DESKTOP (ICON + TEKST) & MOBIEL-TICKER
   ============================================ */

.tf-usp-bar-static {
  background: radial-gradient(circle at top, #111827 0, #020617 55%);
  color: #f9fafb;
  border-bottom: 1px solid rgba(15,23,42,0.85);
}

/* Desktop / basis */
.tf-usp-bar-static-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Op grotere schermen: mooi verdeeld over de breedte */
@media (min-width: 1024px) {
  .tf-usp-bar-static-inner {
    justify-content: space-between;
  }
}

/* Iedere USP als chip – desktop */
.tf-usp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  box-shadow: 0 4px 12px rgba(15,23,42,0.6);
  font-size: 14px;
  white-space: nowrap;
}

.tf-usp-icon {
  font-size: 16px;
}

.tf-usp-label {
  letter-spacing: 0.01em;
}

/* Hover effect – subtiel, alleen op devices met hover */
@media (hover: hover) {
  .tf-usp-chip {
    transition:
      transform 0.16s ease-out,
      box-shadow 0.16s ease-out,
      background 0.16s ease-out;
  }
  .tf-usp-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15,23,42,0.85);
    background: rgba(15,23,42,0.98);
  }
}

/* MOBIEL: ticker-animatie */
@keyframes tfUspMobileTicker {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

@media (max-width: 768px) {

  .tf-usp-bar-static-inner {
    max-width: 100%;
    padding: 8px 0;
    overflow: hidden;
    display: block;
    white-space: nowrap;
    gap: 0;
    justify-content: flex-start;
  }

  .tf-usp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin-right: 18px;
    border-radius: 999px;
    background: rgba(15,23,42,0.9);
    box-shadow: 0 3px 8px rgba(15,23,42,0.6);
    font-size: 13px;
    white-space: nowrap;
  }

  .tf-usp-icon {
    font-size: 15px;
  }

  .tf-usp-bar-static-inner {
    animation: tfUspMobileTicker 24s linear infinite;
  }
}

/* ============================================
   4. ANIMATED SALE-BADGE – UITVERKOOP + %
   ============================================ */

@keyframes tfSalePulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(249,115,22,0.45); }
  50%  { transform: scale(1.07); box-shadow: 0 0 0 8px rgba(249,115,22,0); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}

/* Wrapper vervangt standaard .onsale */
.woocommerce span.onsale.tf-sale-badge {
  position: absolute;
  top: 10px;
  right: 10px;

  display: inline-flex;
  align-items: stretch;
  overflow: hidden;

  border-radius: 999px;
  background: transparent;
  padding: 0;
  min-width: 0;
  min-height: 0;

  box-shadow: 0 4px 10px rgba(15,23,42,0.45);
  z-index: 20;
}

/* Linker helft: Uitverkoop label */
.tf-sale-badge .tf-sale-label {
  background: #0f172a;
  color: #f9fafb;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  display: inline-flex;
  align-items: center;
}

/* Rechter helft: dynamische % met animatie */
.tf-sale-badge .tf-sale-percent {
  background: #f97316;
  color: #111827;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: tfSalePulse 1.8s ease-in-out infinite;
}

/* Kleinere badge op heel kleine schermen */
@media (max-width: 480px) {
  .woocommerce span.onsale.tf-sale-badge {
    top: 8px;
    right: 8px;
  }
  .tf-sale-badge .tf-sale-label,
  .tf-sale-badge .tf-sale-percent {
    padding: 5px 8px;
    font-size: 11px;
  }
}

/* ============================================
   5. PRODUCTS GRID (basis)
   ============================================ */

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
  gap: 14px;
}

.woocommerce ul.products li.product {
  padding: 12px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Verberg standaard Woo-voorraadtekst */
.woocommerce .product .stock,
.woocommerce ul.products li.product .stock {
  display: none !important;
}