/* ═══════════════════════════════════════════════════════════════
   YOGGIES — HOOFDPAGE PRODUCT
   CSS volledig in stijl van de Yoggies Calculator
   HTML en JS zijn NIET gewijzigd — alleen deze CSS vervangen
═══════════════════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --brown:        #3c1e00;
  --brown-mid:    #7a3b1e;
  --green:        #A1E647;
  --green-dark:   #7dc400;
  --cream:        #f5f1e6;
  --cream-deep:   #e9e2c8;
  --white:        #ffffff;
  --text:         #1e1007;
  --text-muted:   #8a7560;
  --border:       rgba(60,30,0,.10);
  --shadow-xs:    0 1px 4px rgba(60,30,0,.07);
  --shadow-sm:    0 2px 10px rgba(60,30,0,.09);
  --shadow-md:    0 6px 28px rgba(60,30,0,.13);
  --shadow-lg:    0 18px 56px rgba(60,30,0,.16);
  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    20px;
  --ease:         cubic-bezier(.4,0,.2,1);

  /* Legacy-namen die de originele CSS gebruikt */
  --dark-brown:   #3c1e00;
  --medium-brown: #7a3b1e;
  --text-dark:    #1e1007;
  --text-gray:    #8a7560;
  --gray-bg:      #e9e2c8;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', 'Lato', sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
}

/* ── TOP BARS ────────────────────────────────────────────────── */
.top-dark  { background: var(--brown); height: 16px; }
.top-green { background: var(--green); height: 11px; }

/* ── HEADER ──────────────────────────────────────────────────── */
header {
  background: var(--white);
  display: flex;
  align-items: center;
  padding: 16px 48px;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 500;
  box-shadow: var(--shadow-xs);
}

.logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.logo-svg { height: 38px; width: auto; display: block; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream);
  border: 1.5px solid var(--cream-deep);
  border-radius: 30px;
  padding: 7px 14px;
  width: 260px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search-bar:focus-within {
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(125,196,0,.13);
}
.search-bar input {
  border: none; outline: none; background: transparent;
  font-family: 'Nunito', sans-serif;
  font-size: 14px; color: var(--text); width: 100%;
}
.search-bar input::placeholder { color: var(--text-muted); }

.search-btn {
  background: var(--green);
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 20px;
  flex-shrink: 0;
  line-height: 1;
  transition: background .18s;
}
.search-btn:hover { background: var(--green-dark); }

/* ── NAV ─────────────────────────────────────────────────────── */
nav.main-nav {
  background: var(--white);
  padding: 0 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 400;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }

.nav-item { position: relative; }

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  padding: 14px 12px;
  display: inline-block;
  font-family: 'Nunito', sans-serif;
  transition: color .18s;
}
.nav-link:hover { color: var(--green-dark); }

.nav-link.nav-home {
  background: var(--brown-mid);
  color: var(--white) !important;
  padding: 6px 13px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  margin-right: 6px;
  transition: background .18s;
}
.nav-link.nav-home:hover { background: var(--brown); color: var(--white) !important; }

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown {
  display: none;
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 1100px;
  min-width: 600px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 600;
  padding: 28px 32px;
  border: 1px solid var(--border);
  animation: fadeDown .16s var(--ease);
}
@keyframes fadeDown {
  from { opacity:0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity:1; transform: translateX(-50%) translateY(0); }
}
.nav-item:hover > .dropdown { display: block; }

.dropdown-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: background .16s, color .16s, transform .16s;
  white-space: normal;
  line-height: 1.3;
}
.dd-item:hover {
  background: var(--green);
  color: var(--brown);
  transform: translateY(-2px);
}

.dd-thumb {
  width: 38px; height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 5px;
  background: var(--white);
}
.dd-item:hover .dd-thumb { background: rgba(255,255,255,.25); }

/* ── PRODUCTS PAGE WRAPPER ───────────────────────────────────── */
.products-page {
  background: var(--cream);
  padding: 36px 48px 56px;
  min-height: 50vh;
}

/* ── Page header ─────────────────────────────────────────────── */
.pg-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
}
.pg-title {
  font-family: 'Playfair Display', 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--brown);
  line-height: 1;
  margin: 0;
}
.pg-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── GRID ────────────────────────────────────────────────────── */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ── CARD ────────────────────────────────────────────────────── */
.pg-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: box-shadow .22s var(--ease), transform .22s var(--ease);
  cursor: pointer;
  position: relative;
}
.pg-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* ── Card image ──────────────────────────────────────────────── */
.pg-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--cream);
  overflow: hidden;
}
.pg-img-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .35s var(--ease);
}
.pg-card:hover .pg-img-wrap img { transform: scale(1.05); }

/* ── Badge ───────────────────────────────────────────────────── */
.pg-badge {
  position: absolute;
  top: 11px; left: 11px;
  z-index: 2;
  background: var(--green-dark);
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: .4px;
  line-height: 1.4;
}
.pg-badge--new  { background: #e07c1a; }
.pg-badge--sale { background: #d63a2f; }
.pg-badge--vet  { background: #2f7fd6; }

/* ── Card body ───────────────────────────────────────────────── */
.pg-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

/* ── Product name ────────────────────────────────────────────── */
.pg-name {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Rating ──────────────────────────────────────────────────── */
.pg-rating {
  display: flex;
  align-items: center;
  gap: 5px;
}
.pg-stars    { color: #f4b942; font-size: 13px; letter-spacing: 1px; line-height: 1; }
.pg-star-off { color: var(--cream-deep); }
.pg-rcount   { font-size: 12px; color: var(--text-muted); }

/* ── Description ─────────────────────────────────────────────── */
.pg-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Footer: price + cart ────────────────────────────────────── */
.pg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.pg-price { display: flex; flex-direction: column; gap: 2px; }
.pg-price-main {
  font-family: 'Nunito', sans-serif;
  font-size: 21px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.pg-price-per { font-size: 11px; color: var(--text-muted); line-height: 1; }

/* ── Cart button ─────────────────────────────────────────────── */
.pg-cart-btn {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--brown);
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, transform .15s, box-shadow .18s;
  box-shadow: 0 3px 10px rgba(60,30,0,.20);
}
.pg-cart-btn svg { width: 17px; height: 17px; pointer-events: none; }
.pg-cart-btn:hover  {
  background: var(--brown-mid);
  transform: scale(1.1);
  box-shadow: 0 5px 16px rgba(60,30,0,.28);
}
.pg-cart-btn:active { transform: scale(0.95); }
.pg-cart-btn.pg-added { background: var(--green-dark); }

/* ── PAGINATION ──────────────────────────────────────────────── */
.pg-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 44px;
}
.pg-page-btn {
  min-width: 38px; height: 38px;
  padding: 0 8px;
  border: 1.5px solid var(--cream-deep);
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
  box-shadow: var(--shadow-xs);
}
.pg-page-btn:hover,
.pg-page-btn--active {
  background: var(--brown);
  border-color: var(--brown);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(60,30,0,.22);
}

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  background: var(--brown);
  padding: 44px 48px 52px;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-card {
  background: rgba(255,255,255,.10);
  border-radius: var(--radius);
  width: 160px;
  height: 200px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.08);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pg-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  header, nav.main-nav, footer { padding-left: 24px; padding-right: 24px; }
  .products-page { padding: 24px 24px 40px; }
  .pg-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .dropdown { min-width: 380px; }
  .dropdown-inner { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  header { padding: 14px 16px; }
  nav.main-nav { padding: 0 16px; }
  .products-page { padding: 18px 16px 32px; }
  .pg-grid { grid-template-columns: 1fr; gap: 14px; }
  .pg-title { font-size: 22px; }
  .search-bar { width: 160px; }
  footer { padding: 36px 16px 40px; }
  .dropdown { min-width: 300px; }
  .dropdown-inner { grid-template-columns: repeat(2, 1fr); }
}

/* Dropdown alignment fix - anchor to nav-item edges */
nav.main-nav .nav-item > .dropdown { left: 0; right: auto; transform: none; }
nav.main-nav .nav-item:nth-last-child(-n+3) > .dropdown { left: auto; right: 0; }


/* Centered dropdown on nav bar - same position for all categories */
nav.main-nav .nav-list .nav-item { position: static; }
nav.main-nav .nav-item > .dropdown,
nav.main-nav .nav-item:nth-last-child(-n+3) > .dropdown {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
