/* ════════════════════════════════════════════════════════════
   UI Polish — typography, visibility & conflict fixes (load last)
   ════════════════════════════════════════════════════════════ */

/* ── Unified typography ── */
body.pd-layout,
body.pd-layout button,
body.pd-layout input,
body.pd-layout select,
body.pd-layout textarea {
  font-family: 'Public Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

body.pd-layout h1,
body.pd-layout h2,
body.pd-layout h3,
body.pd-layout h4,
body.pd-layout h5,
body.pd-layout h6 {
  font-family: 'Public Sans', 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── Top strip — readable contrast ── */
.pd-topstrip {
  background: #eef3e8;
  border-bottom-color: #d8e2cc;
  font-size: 0.84rem;
  color: #1f2937;
}
.pd-topstrip-links a {
  color: #1f2937;
  font-weight: 600;
}
.pd-topstrip-action {
  color: #374151;
  font-weight: 600;
}
.pd-topstrip-auth a {
  color: #111827;
  font-weight: 700;
}

/* ── Header pills — clear labels, no clipping ── */
.pd-header-pill {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 78px;
  min-height: 52px;
  padding: 8px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}
.pd-header-pill .pd-pill-text {
  display: block;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}
.pd-header-pill i {
  font-size: 1.2rem;
  line-height: 1;
}

/* Kill legacy cart-btn sizing inside Pansari Direct header */
.pd-layout .pd-header-actions .pd-header-pill,
.pd-layout .pd-header-actions .pd-cart-pill,
.pd-layout .pd-header-actions a.pd-cart-pill {
  width: auto !important;
  min-width: 78px !important;
  height: auto !important;
  min-height: 52px !important;
  max-width: none !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 14px !important;
  border-radius: 10px !important;
  transform: none !important;
}
.pd-layout .pd-header-actions .pd-cart-pill {
  min-width: 104px !important;
  padding: 10px 18px !important;
  background: var(--sp-premium-forest, #3D6B1E) !important;
  border-color: var(--sp-premium-forest, #3D6B1E) !important;
  color: #fff !important;
}
.pd-layout .pd-header-actions .pd-cart-pill i {
  color: #fff !important;
}
.pd-layout .pd-header-actions .pd-cart-pill:hover {
  background: #2D5016 !important;
  border-color: #2D5016 !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(61, 107, 30, 0.28);
}
.pd-layout .pd-header-actions .pd-header-user {
  width: auto !important;
  height: auto !important;
  min-width: 78px !important;
  min-height: 52px !important;
  border: 1px solid #e5e7eb !important;
  background: #fff !important;
}

/* ── Category ribbon — larger, readable labels ── */
.pd-cat-ribbon {
  gap: 12px;
  padding: 14px 8px 18px;
}
.pd-cat-ribbon-item {
  width: 96px;
  gap: 10px;
}
.pd-cat-ribbon-img {
  width: 68px;
  height: 68px;
}
.pd-cat-ribbon-label {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  max-width: 94px;
  color: #1f2937;
  letter-spacing: 0.01em;
}

/* ── Hero — white headline on all screen sizes ── */
.hero-swiper .slide-title,
.slide-content .slide-title,
.hero-swiper h1.slide-title {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
}
.hero-swiper .slide-subtitle {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.hero-swiper .slide-badge {
  font-family: 'Public Sans', 'Inter', sans-serif;
}

@media (min-width: 992px) {
  .hero-swiper {
    height: 520px !important;
  }
  .hero-swiper .slide-title {
    font-size: clamp(2.25rem, 3.8vw, 3.25rem) !important;
    line-height: 1.08 !important;
  }
  .pd-header-pill {
    min-width: 84px;
    font-size: 0.72rem;
  }
  .pd-layout .pd-header-actions .pd-cart-pill {
    min-width: 118px !important;
  }
}

@media (max-width: 991px) {
  .pd-header-pill span.pd-pill-text {
    display: none;
  }
  .pd-layout .pd-header-actions .pd-header-pill,
  .pd-layout .pd-header-actions .pd-cart-pill {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px !important;
  }
}

/* ── Dark / light theme ── */
html[data-theme="dark"] body.pd-layout {
  --sp-surface: #1a1f16;
  background: #0f120d;
  color: #e8ece3;
}
html[data-theme="dark"] .pd-topstrip { background: #1a2018; color: #e5e7eb; }
html[data-theme="dark"] .sp-premium-card,
html[data-theme="dark"] .pd-header-pill { background: #1f261c; border-color: #2d3828; color: #e8ece3; }
html[data-theme="dark"] .sanju-bottom-nav.bottom-nav { background: rgba(26, 32, 24, 0.98) !important; border-top-color: #2d3828 !important; }

.sp-theme-toggle {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 12px;
  z-index: 990;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #dce8d0;
  background: rgba(255, 255, 255, 0.92);
  color: #3D6B1E;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.sp-theme-toggle:hover { transform: scale(1.05); }
.sp-theme-toggle:focus-visible {
  outline: 2px solid var(--ds-lime, #9ACD32);
  outline-offset: 2px;
  box-shadow: var(--ds-focus-ring, 0 0 0 3px rgba(154, 205, 50, 0.45));
}
html[data-theme="dark"] .sp-theme-toggle {
  background: #1f261c;
  border-color: #3d4a36;
  color: #9ACD32;
}
@media (min-width: 992px) {
  .sp-theme-toggle { top: auto; bottom: 88px; right: 24px; }
}

