/*
 * VD Electronics — Design System v2.0
 * "Editorial Architect" — Power-Premium Aesthetic
 * Based on DESIGN.md design tokens
 */

/* ── Search Dropdown ─────────────────────────────────────────────────────── */
.sd-wrapper { position: relative; flex: 1; min-width: 0; }

.sd-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 99999;
  max-height: 540px;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.sd-dropdown.sd-open { display: block; }

/* Section labels */
.sd-section-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 12px 16px 5px;
}

/* Category rows */
.sd-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  text-decoration: none;
  color: #374151;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  border-left: 3px solid transparent;
  transition: background .1s, border-color .1s;
}
.sd-cat-row:hover,
.sd-cat-row.sd-active {
  background: #fef2f2;
  border-left-color: #bd000b;
}
.sd-cat-name { flex: 1; }
.sd-cat-count {
  font-size: 11.5px;
  color: #9ca3af;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

/* Product rows */
.sd-prod-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 16px;
  text-decoration: none;
  color: #1a1c1e;
  border-left: 3px solid transparent;
  transition: background .1s, border-color .1s;
}
.sd-prod-row:hover,
.sd-prod-row.sd-active {
  background: #fef2f2;
  border-left-color: #bd000b;
}

/* Product image */
.sd-prod-img-wrap { flex-shrink: 0; }
.sd-prod-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #f0f0f0;
  background: #f9fafb;
  display: block;
}
.sd-prod-img-ph {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Product info */
.sd-prod-info { flex: 1; min-width: 0; }
.sd-prod-name {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.sd-prod-pricing {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
}
.sd-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #bd000b;
}
.sd-mrp {
  font-size: 11.5px;
  color: #9ca3af;
  text-decoration: line-through;
  font-family: 'Inter', sans-serif;
}
.sd-discount {
  font-size: 10.5px;
  font-weight: 700;
  color: #16a34a;
  background: #dcfce7;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
}

/* Star rating bar */
.sd-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}
.sd-starbar {
  display: inline-block;
  width: 60px;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
}
.sd-starbar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 4px;
}
.sd-rc  { font-size: 11px; color: #f59e0b; font-weight: 600; font-family: 'Inter', sans-serif; }
.sd-rc2 { font-size: 11px; color: #9ca3af; font-family: 'Inter', sans-serif; }

/* Category chip */
.sd-cat-chip {
  font-size: 11px;
  color: #6b7280;
  margin-top: 3px;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* See all footer */
.sd-see-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 16px;
  font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  color: #bd000b;
  text-decoration: none;
  border-top: 1.5px solid #f3f4f6;
  transition: background .12s;
}
.sd-see-all:hover { background: #fff5f5; border-radius: 0 0 14px 14px; }
.sd-see-all strong { font-weight: 800; }

/* Empty state */
.sd-empty {
  padding: 28px 16px;
  text-align: center;
  color: #9ca3af;
  font-family: 'Inter', sans-serif;
}
.sd-empty svg { margin: 0 auto 10px; display: block; opacity: .5; }
.sd-empty div { font-size: 13.5px; color: #374151; font-weight: 500; margin-bottom: 4px; }
.sd-empty-hint { font-size: 12px; color: #9ca3af; }

/* Loading */
.sd-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 16px;
  color: #9ca3af;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}
.sd-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #f3f4f6;
  border-top-color: #bd000b;
  border-radius: 50%;
  display: inline-block;
  animation: sd-spin .65s linear infinite;
  flex-shrink: 0;
}
@keyframes sd-spin { to { transform: rotate(360deg); } }

/* ── Google Fonts ────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ── Design Tokens ───────────────────────────────────────────────────────── */
:root {
  /* Primary — High-Energy Red */
  --clr-primary:            #bd000b;
  --clr-primary-container:  #e42520;
  --clr-on-primary:         #ffffff;

  /* Secondary — Deep Blue */
  --clr-secondary:          #3c5aae;
  --clr-secondary-container:#88a5ff;
  --clr-on-secondary:       #ffffff;

  /* Tertiary — Gold (trust / promo badges) */
  --clr-tertiary:           #884f00;
  --clr-tertiary-fixed:     #ffddb3;

  /* Surface Hierarchy */
  --clr-surface:            #f9f9fc;   /* page base */
  --clr-surface-low:        #f3f3f6;   /* section blocks */
  --clr-surface-lowest:     #ffffff;   /* cards / interactive */
  --clr-surface-highest:    #e2e2e5;   /* overlays / alerts */

  /* Text */
  --clr-on-surface:         #1a1c1e;   /* primary text — never pure #000 */
  --clr-on-surface-variant: #44474f;   /* secondary text */
  --clr-muted:              #6b7280;   /* placeholder / captions */

  /* Outline — Ghost borders only (use at 15% opacity) */
  --clr-outline-variant:    #e7bdb7;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #bd000b 0%, #e42520 100%);
  --gradient-secondary: linear-gradient(135deg, #3c5aae 0%, #88a5ff 100%);

  /* Shadows — Ambient Glow (min blur 16px) */
  --shadow-sm:  0px 12px 32px rgba(26, 28, 30, 0.06);
  --shadow-md:  0px 16px 40px rgba(26, 28, 30, 0.10);
  --shadow-lg:  0px 24px 56px rgba(26, 28, 30, 0.14);

  /* Typography */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Radius */
  --radius-btn:  0.375rem;   /* 6px — buttons */
  --radius-card: 0.75rem;    /* 12px — cards */
  --radius-lg:   1rem;       /* 16px — large containers */
}

/* ── Base Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--clr-surface);
  color: var(--clr-on-surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.font-poppins, .font-display, .font-jakarta {
  font-family: var(--font-display) !important;
}

/* ── Glassmorphism Header ────────────────────────────────────────────────── */
/* Override the existing .header-sticky class across all user pages */
.header-sticky {
  background: rgba(249, 249, 252, 0.82) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  box-shadow: none !important; /* tonal separation — no hard shadow line */
}
.vd-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 249, 252, 0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  /* No hard border — tonal separation only */
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.vd-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--gradient-primary);
  color: var(--clr-on-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  width: 100%;
}
.vd-btn-primary:hover {
  transform: scale(1.01);
  box-shadow: 0px 8px 24px rgba(189, 0, 11, 0.30);
}

.vd-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--clr-secondary-container);
  color: var(--clr-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  width: 100%;
}
.vd-btn-secondary:hover {
  background: var(--clr-secondary);
  color: var(--clr-on-secondary);
}

.vd-btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--clr-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.vd-btn-tertiary:hover { background: rgba(189, 0, 11, 0.06); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.vd-card {
  background: var(--clr-surface-lowest);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  /* NO borders — surface differentiation only */
  transition: transform 0.25s, box-shadow 0.25s;
}
.vd-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ── Product Card ────────────────────────────────────────────────────────── */
.vd-product-card {
  background: var(--clr-surface-lowest);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.vd-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.vd-product-card .price {
  color: var(--clr-primary);
  font-family: var(--font-display);
  font-weight: 800;
}

/* ── Filter Chips ────────────────────────────────────────────────────────── */
.vd-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1rem;
  background: var(--clr-surface-highest);
  color: var(--clr-on-surface-variant);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 2rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}
.vd-chip:hover, .vd-chip.active {
  background: var(--clr-secondary);
  color: var(--clr-on-secondary);
}

/* ── Promo Badges ────────────────────────────────────────────────────────── */
.vd-badge-discount {
  background: #22c55e;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.625rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}
.vd-badge-promo {
  background: var(--clr-tertiary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.625rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}
.vd-badge-new {
  background: var(--gradient-primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.625rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 4px;
}

/* ── Input Fields ────────────────────────────────────────────────────────── */
.vd-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--clr-surface-low);
  border: 2px solid transparent;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--clr-on-surface);
  outline: none;
  transition: border-color 0.2s;
}
.vd-input:focus {
  border-color: rgba(189, 0, 11, 0.40); /* Ghost border at 40% */
}
.vd-input::placeholder { color: var(--clr-muted); }

/* ── Trust / Warranty Badges ─────────────────────────────────────────────── */
.vd-trust-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--clr-tertiary-fixed);
  color: var(--clr-tertiary);
  border-radius: var(--radius-btn);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ── Section Surfaces ────────────────────────────────────────────────────── */
.vd-surface        { background: var(--clr-surface); }
.vd-surface-low    { background: var(--clr-surface-low); }
.vd-surface-lowest { background: var(--clr-surface-lowest); }

/* ── Gradient Text ───────────────────────────────────────────────────────── */
.vd-gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Scrollbar Hide ──────────────────────────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Mobile / Desktop Visibility ─────────────────────────────────────────── */
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
}

/* ── Ambient Quick-Buy Shadow ────────────────────────────────────────────── */
.vd-modal-shadow {
  box-shadow: 0px 12px 32px rgba(26, 28, 30, 0.06);
}

/* ── Mobile Bottom Navigation — Glass Strip ──────────────────────────────── */
.mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-top: none !important;
  box-shadow: 0px -8px 24px rgba(26, 28, 30, 0.07) !important;
}

/* ── Franchisee/Employee Portal Topbar — No Hard Line ────────────────────── */
#frnTopbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  /* Ghost border fallback (accessibility) per spec: outline_variant at 15% */
  border-bottom: 1px solid rgba(231, 189, 183, 0.15) !important;
}

/* ── "Ghost Border" Fallback for Accessibility ───────────────────────────── */
/* When a border is required, outline_variant (#e7bdb7) at 15% opacity only */
.ghost-border {
  border: 1px solid rgba(231, 189, 183, 0.15) !important;
}

/* ── Pricing — Primary color per design spec ─────────────────────────────── */
/* "Use primary for prices to draw the eye immediately" */
.font-poppins.font-black.text-3xl,
.font-poppins.font-bold.text-base,
.font-poppins.font-bold.text-lg,
.font-poppins.font-black.text-2xl {
  /* Prices already set inline, but ensure headings stay on-surface */
  color: var(--clr-on-surface);
}

/* ── Trust Element Colour (Tertiary Fixed) ───────────────────────────────── */
/* Used for warranty / secure-payment badges */
.trust-badge,
[class*="warranty"],
[class*="secure"] {
  color: var(--clr-tertiary) !important;
}

/* ── Rating Stars ────────────────────────────────────────────────────────── */
.vd-stars { color: #fbbf24; }

/* ── Gradient Text Utility ───────────────────────────────────────────────── */
.text-primary    { color: var(--clr-primary) !important; }
.text-secondary  { color: var(--clr-secondary) !important; }
.text-on-surface { color: var(--clr-on-surface) !important; }
.text-muted      { color: var(--clr-muted) !important; }

/* ── Backward-compat overrides for existing Tailwind custom classes ──────── */
/* These ensure pages using old class names get the new colours */
.btn-gradient, .btn-primary {
  background: var(--gradient-primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius-btn) !important;
  font-family: var(--font-display) !important;
}
.btn-outline, .btn-secondary {
  background: var(--clr-secondary-container) !important;
  color: var(--clr-secondary) !important;
  border: none !important;
  border-radius: var(--radius-btn) !important;
  font-family: var(--font-display) !important;
}
.btn-outline:hover, .btn-secondary:hover {
  background: var(--clr-secondary) !important;
  color: #fff !important;
}

/* ── "No-Line" Rule — All Card / Surface Containers ─────────────────────── */
/* Per DESIGN.md: 1px solid borders are FORBIDDEN.
   Depth is defined by background shifts and ambient shadow only.          */
.product-card,
.product-card-list,
.admin-card,
.stat-card,
.value-card,
.blog-card,
.testimonial-card,
.filter-sidebar,
.review-card,
.offer-pill,
.faq-item {
  box-shadow: var(--shadow-sm) !important;
  border: none !important;
  border-radius: var(--radius-card) !important;
}

/* Franchisee accent card — keep decorative left-gradient border only */
.franchisee-card {
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Input ghost-border focus (allowed per spec: primary at 40% opacity) */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(189, 0, 11, 0.40) !important;
  box-shadow: none !important;
}

/* Chip selection state */
.vd-chip.active,
.vd-chip:focus {
  background: var(--clr-secondary) !important;
  color: var(--clr-on-secondary) !important;
}

/* Price colour — draw the eye with primary per design spec */
.price, [class*="price"], .product-price {
  color: var(--clr-primary) !important;
}

/* Section backgrounds — Editorial layering */
.bg-brand-bg, .bg-\[#f9f9fc\], .bg-gray-50 {
  background: var(--clr-surface-low) !important;
}

