/* ════════════════════════════════════════════════════
   KachaBazar — Homepage Styles
   ONLY loaded on the homepage template.
   ════════════════════════════════════════════════════ */

/* ── Admin bar offsets ───────────────────────────── */
#wpadminbar { z-index: 9999 !important; }
body.kbz-page { overflow-x: hidden; margin: 0 !important; padding: 0 !important; }
body.admin-bar .kbz-header  { top: 32px !important; }
body.admin-bar .kbz-subnav  { top: calc(32px + var(--header-height)) !important; }
body.admin-bar .kbz-wrap    { padding-top: calc(32px + var(--header-height) + var(--subnav-height)) !important; }
@media screen and (max-width:782px) {
  body.admin-bar .kbz-header { top: 46px !important; }
  body.admin-bar .kbz-subnav { top: calc(46px + var(--header-height)) !important; }
  body.admin-bar .kbz-wrap   { padding-top: calc(46px + var(--header-height) + var(--subnav-height)) !important; }
}

/* ── Dark header theme ───────────────────────────── */
.kbz-page .kbz-header { background: #0f1111 !important; border-bottom: none !important; box-shadow: none !important; }
.kbz-page .kbz-wrap { padding-top: calc(var(--header-height) + var(--subnav-height)) !important; margin: 0 !important; }
.kbz-page .kbz-wrap > * { margin-top: 0 !important; }
.kbz-page .kbz-wrap section { margin: 0 !important; }

.kbz-page .kbz-search { background: white !important; border: none !important; max-width: 740px !important; }
.kbz-page .kbz-search input { color: var(--color-gray-900) !important; }

/* Header icon buttons */
.kbz-header-icon-btn {
  display: flex; align-items: center; justify-content: center;
  position: relative; width: 40px; height: 40px;
  border-radius: 50%; background: none; border: none; cursor: pointer;
  color: white; transition: background var(--t-fast); text-decoration: none;
}
.kbz-header-icon-btn:hover { background: rgba(255,255,255,.12); }
.kbz-header-icon-btn .kbz-cart-badge { position: absolute; top: 2px; right: 2px; background: var(--color-sale); color: white; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.kbz-cart-text-sm  { font-size: 11px; color: rgba(255,255,255,.6); line-height: 1; }
.kbz-cart-text-val { font-size: 14px; font-weight: 700; color: var(--color-primary-300); font-family: var(--font-display); }
.kbz-user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--color-gray-700); border: 2px solid var(--color-gray-600); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.kbz-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Secondary nav ── */
.kbz-page .kbz-subnav { background: white !important; border-bottom: 1px solid var(--color-border) !important; box-shadow: 0 1px 3px rgba(0,0,0,.06) !important; }
.kbz-cats-nav-btn { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--color-gray-700); padding: 0 12px; height: var(--subnav-height); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; transition: color var(--t-fast), border-color var(--t-fast); white-space: nowrap; }
.kbz-cats-nav-btn:hover { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.kbz-nav-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 5px; vertical-align: middle; }

/* ── Hero ─────────────────────────────────────────── */
.kbz-hero-section { padding: 20px 0 0; margin: 0 !important; }
.kbz-hero-grid { display: grid; grid-template-columns: 1fr 420px; gap: 20px; align-items: stretch; }
.kbz-hero-slider-wrap { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }

/* ── Slider ──────────────────────────────────────── */
.kbz-slider { position: relative; overflow: hidden; border-radius: 0; }
.kbz-slider__track { display: flex; transition: transform .55s cubic-bezier(.4,0,.2,1); }
.kbz-slide { min-width: 100%; position: relative; background: #f7f7f2; }
.kbz-slide img { width: 100%; height: 360px; object-fit: cover; display: block; }
.kbz-slide.dark::after  { content:''; position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,10,20,.62) 0%,rgba(10,10,20,.25) 55%,transparent 100%); }
.kbz-slide.light::after { content:''; position:absolute;inset:0;background:linear-gradient(90deg,rgba(255,255,255,.9) 0%,rgba(255,255,255,.55) 45%,transparent 100%); }
.kbz-slide.dark  .kbz-slide__eyebrow { color: var(--color-primary-300); }
.kbz-slide.dark  .kbz-slide__title   { color: white; }
.kbz-slide.dark  .kbz-slide__sub     { color: rgba(255,255,255,.85); }
.kbz-slide.light .kbz-slide__eyebrow { color: var(--color-primary); }
.kbz-slide.light .kbz-slide__title   { color: var(--color-gray-900); }
.kbz-slide.light .kbz-slide__sub     { color: var(--color-gray-600); }
.kbz-slide__content { position: absolute; top: 50%; left: 8%; transform: translateY(-50%); z-index: 2; max-width: 50%; }
.kbz-slide__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.kbz-slide__title { font-family: var(--font-display); font-size: clamp(1.25rem,2.5vw,1.9rem); font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.kbz-slide__sub { font-size: 13px; line-height: 1.65; margin-bottom: 20px; max-width: 340px; }
.kbz-slider__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; background: rgba(255,255,255,.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; border: none; color: var(--color-gray-700); transition: background .2s, transform .2s; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.kbz-slider__arrow:hover { background: white; transform: translateY(-50%) scale(1.08); }
.kbz-slider__prev { left: 12px; }
.kbz-slider__next { right: 12px; }
.kbz-slider__dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; }
.kbz-dot { width: 8px; height: 8px; border-radius: 99px; background: rgba(0,0,0,.25); cursor: pointer; transition: all .3s; border: none; padding: 0; }
.kbz-dot.active { background: var(--color-primary); width: 22px; }
.kbz-slide.dark .kbz-dot { background: rgba(255,255,255,.4); }
.kbz-slide.dark .kbz-dot.active { background: white; }

/* ── Coupon Box ──────────────────────────────────── */
.kbz-coupon-box { background: white; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.kbz-coupon-box__head { background: var(--color-bg-muted); padding: 14px 18px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--color-gray-700); border-bottom: 1px solid var(--color-border); flex-shrink: 0; }
.kbz-coupon-item { display: grid; grid-template-columns: 82px 1fr; gap: 14px; padding: 20px 18px; border-bottom: 1px solid #f0f0f0; flex: 1; align-content: center; }
.kbz-coupon-item:last-child { border-bottom: none; }
.kbz-coupon-item__img { width: 82px; height: 82px; object-fit: cover; border-radius: var(--radius-md); align-self: center; }
.kbz-coupon-meta { display: flex; flex-direction: column; gap: 6px; }
.kbz-coupon-row  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kbz-coupon-pct  { font-size: 14px; font-weight: 700; color: var(--color-gray-700); }
.kbz-coupon-pct span { color: var(--color-sale); }
.kbz-coupon-status { background: #fce7f3; color: #be185d; font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; display: inline-block; }
.kbz-coupon-title { font-size: 13.5px; font-weight: 700; color: var(--color-text-primary); }
.kbz-countdown { display: flex; align-items: center; gap: 3px; }
.kbz-cd-box { background: var(--color-sale); color: white; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 4px; min-width: 30px; text-align: center; font-family: var(--font-display); }
.kbz-cd-sep { font-size: 13px; font-weight: 800; color: var(--color-gray-700); }
.kbz-coupon-code { display: inline-block; border: 1.5px dashed var(--color-gray-400); padding: 5px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 700; color: var(--color-gray-700); letter-spacing: .1em; cursor: pointer; font-family: monospace; background: #fafafa; transition: border-color var(--t-fast); }
.kbz-coupon-code:hover { border-color: var(--color-primary); color: var(--color-primary); }
.kbz-coupon-note { font-size: 10.5px; color: var(--color-text-muted); line-height: 1.4; }

/* ── Promo strip ─────────────────────────────────── */
.kbz-promo-strip { background: var(--color-bg-muted); padding: 22px 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); margin: 20px 0 0 !important; }

/* ── Service strip ───────────────────────────────── */
.kbz-service-strip { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.kbz-service-item { background: white; padding: var(--space-5) var(--space-6); display: flex; align-items: center; gap: var(--space-4); }
.kbz-service-item__icon { width: 44px; height: 44px; background: var(--color-primary-50); color: var(--color-primary); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kbz-service-item__title { font-size: 13px; font-weight: 700; color: var(--color-text-primary); margin-bottom: 2px; }
.kbz-service-item__sub { font-size: 11px; color: var(--color-text-muted); }

/* ── Section headings ────────────────────────────── */
.kbz-section-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--color-text-primary); margin-bottom: 4px; }
.kbz-section-sub   { font-size: 13px; color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 0; }
.kbz-section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.kbz-sec-divider { width: 56px; height: 3px; background: var(--color-primary); border-radius: 2px; margin-top: 6px; }
.kbz-view-all { font-size: 13px; color: var(--color-primary); font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.kbz-view-all:hover { color: var(--color-primary-700); gap: 8px; }
.kbz-cat-prod-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.kbz-cat-prod-title { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--color-text-primary); }
.kbz-cat-prod-sub { font-size: 12px; color: var(--color-text-secondary); line-height: 1.55; margin-top: 4px; max-width: 520px; }

/* ── Featured category grid ──────────────────────── */
.kbz-feat-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 14px; }

/* ── Product grid ────────────────────────────────── */
.kbz-prod-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 18px; }

/* ════════════════════════════════════════════════════
   Product Card v3 — BudPop-matched sizing
   Image: aspect-ratio 1:1 (always square, zero cropping)
   Background: #f8f9ff — matches BudPop card bg exactly
   Radius: 20px — BudPop uses 40px on 269px wide cards
   ════════════════════════════════════════════════════ */

/* Card shell */
.kbz-pc3 {
  position: relative; display: flex; flex-direction: column;
  border-radius: 20px; border: 1px solid #e8eaf0;
  background: #f8f9ff; overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  cursor: pointer;
}
.kbz-pc3:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,.13);
  transform: translateY(-4px);
  border-color: rgba(13,148,136,.4);
}

/* Badge — top-right red pill */
.kbz-pc3__badge {
  position: absolute; z-index: 10; top: 12px; right: 12px;
  background: #fef2f2; color: #dc2626;
  font-size: 11px; font-weight: 600; line-height: 1.4;
  padding: 3px 9px; border-radius: 99px;
  border: 1px solid rgba(220,38,38,.15);
}

/* Image area — aspect-ratio 1:1 makes it always perfectly square.
   Since BudPop product images are 1000×1000 (square), object-fit:cover
   fills the area 100% with ZERO cropping — the full product is always shown. */
.kbz-pc3__img-wrap {
  position: relative; width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8f9ff; overflow: hidden; flex-shrink: 0;
}
.kbz-pc3__img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .18s ease-in-out; display: block;
}
.kbz-pc3:hover .kbz-pc3__img { transform: scale(1.04); }

/* Add-to-cart button — bottom-right of image */
.kbz-pc3__add {
  position: absolute; bottom: 12px; right: 12px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--color-gray-900); color: white;
  border: 2px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
  transition: background .2s, transform .15s;
}
.kbz-pc3__add:hover { background: var(--color-primary); transform: scale(1.1); }
.kbz-pc3__add.added { background: var(--color-success); }

/* Body */
.kbz-pc3__body {
  display: flex; flex-direction: column; gap: 7px;
  padding: 12px 16px 28px; flex: 1;
  background: white;
}

/* Product name */
.kbz-pc3__name {
  font-size: 13.5px; font-weight: 600; color: var(--color-text-primary);
  line-height: 1.35; text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.kbz-pc3__name:hover { color: var(--color-primary); }

/* Stars */
.kbz-pc3__stars-row { display: flex; align-items: center; gap: 1.5px; flex-wrap: wrap; }
.kbz-pc3__star { width: 12px; height: 12px; flex-shrink: 0; }
.kbz-pc3__star--f { color: #facc15; }
.kbz-pc3__star--e { color: var(--color-gray-300); }
.kbz-pc3__star-partial { position: relative; display: inline-flex; width: 12px; height: 12px; flex-shrink: 0; }
.kbz-pc3__star-fill { position: absolute; top: 0; left: 0; height: 100%; overflow: hidden; display: flex; }
.kbz-pc3__rev { font-size: 11px; color: var(--color-text-muted); margin-left: 4px; }

/* Price block */
.kbz-pc3__price-block { display: flex; flex-direction: column; gap: 0; margin-top: 2px; }
.kbz-pc3__orig-row { display: flex; align-items: center; justify-content: space-between; }
.kbz-pc3__orig-label { font-size: 11px; color: var(--color-text-muted); }
.kbz-pc3__orig-del { font-size: 11px; font-weight: 500; color: var(--color-text-muted); text-decoration: line-through; }

/* Arc / wave decoration */
.kbz-pc3__arc { display: block; width: 100%; height: auto; margin-top: 4px; margin-bottom: 2px; }

/* Current price — large centered */
.kbz-pc3__price {
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  color: var(--color-text-primary); text-align: center; line-height: 1.2;
  margin-top: 2px;
}
.kbz-pc3__price--solo {
  font-family: var(--font-display); font-size: 20px; font-weight: 800;
  color: var(--color-primary); margin-top: 8px;
}

/* ── App CTA ─────────────────────────────────────── */
.kbz-app-cta { background: linear-gradient(130deg,#0d9488,#0f766e 55%,#115e59); border-radius: 20px; overflow: hidden; display: grid; grid-template-columns: 1fr 320px; min-height: 270px; position: relative; }
.kbz-app-cta::before { content:''; position:absolute;inset:0;background-image:radial-gradient(circle at 70% 50%,rgba(255,255,255,.06),transparent 60%); }
.kbz-app-cta__content { padding: 44px 48px; color: white; display: flex; flex-direction: column; justify-content: center; position: relative; z-index: 1; }
.kbz-app-cta__tag { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.15); padding: 5px 14px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; width: fit-content; }
.kbz-app-cta__img { position: relative; overflow: hidden; }
.kbz-app-cta__img img { position: absolute; bottom: 0; right: 0; height: 115%; width: auto; object-fit: contain; }

/* ── Promo banners ───────────────────────────────── */
.kbz-promo-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kbz-promo-card   { position: relative; border-radius: 14px; overflow: hidden; min-height: 200px; display: flex; align-items: center; padding: 28px 32px; }
.kbz-promo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kbz-promo-overlay  { position: absolute; inset: 0; z-index: 1; }
.kbz-promo-content  { position: relative; z-index: 2; color: white; }
.kbz-promo-eyebrow  { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 5px; opacity: .9; }
.kbz-promo-title    { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.kbz-promo-sub      { font-size: 12px; opacity: .88; line-height: 1.5; margin-bottom: 16px; }

/* ── Homepage responsive ─────────────────────────── */
@media (max-width: 1200px) {
  .kbz-hero-grid  { grid-template-columns: 1fr 380px; }
  .kbz-prod-grid  { grid-template-columns: repeat(4,1fr); }
  .kbz-feat-grid  { grid-template-columns: repeat(5,1fr); }
}
@media (max-width: 1024px) {
  .kbz-hero-grid  { grid-template-columns: 1fr 340px; }
  .kbz-prod-grid  { grid-template-columns: repeat(3,1fr); }
  .kbz-feat-grid  { grid-template-columns: repeat(4,1fr); }
  .kbz-app-cta    { grid-template-columns: 1fr 260px; }
}
@media (max-width: 768px) {
  .kbz-hero-grid  { grid-template-columns: 1fr; }
  .kbz-prod-grid  { grid-template-columns: repeat(2,1fr); }
  .kbz-feat-grid  { grid-template-columns: repeat(3,1fr); }
  .kbz-promo-grid { grid-template-columns: 1fr; }
  .kbz-app-cta    { grid-template-columns: 1fr; }
  .kbz-app-cta__img { display: none; }
  .kbz-slide img  { height: 260px; }
  .kbz-slide__content { max-width: 72%; left: 6%; }
  .kbz-coupon-item { grid-template-columns: 64px 1fr; gap: 10px; padding: 14px; }
  .kbz-coupon-item__img { width: 64px; height: 64px; }
  .kbz-search { max-width: none !important; }
  .kbz-pc3__price { font-size: 20px; }
}
@media (max-width: 480px) {
  .kbz-prod-grid  { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .kbz-feat-grid  { grid-template-columns: repeat(2,1fr); }
  .kbz-slide img  { height: 210px; }
  .kbz-slide__content { max-width: 85%; left: 5%; }
  .kbz-promo-card { min-height: 170px; padding: 24px 22px; }
  .kbz-pc3__price { font-size: 18px; }
}
