/* ==========================================================================
   Nirog Lab theme layer — loaded LAST on every storefront page.
   1) Brand tokens taken from the logo file (storage/settings/…webp)
   2) One humanist UI font (Noto Sans + Noto Sans Devanagari) — Amazon-Ember-like
   3) Layout safety fixes: no image/text overlap, no sideways scroll on phones
   Text and images are not changed anywhere; only colour, type and layout.
   ========================================================================== */

:root {
  /* Logo palette */
  --nl-green: #16533a;        /* "NIROG" wordmark */
  --nl-green-deep: #0f3d2a;   /* hover / pressed */
  --nl-green-ink: #0a2b1e;    /* darkest band */
  --nl-leaf: #88c443;         /* leaf above the "I" */
  --nl-leaf-tint: #eef6e5;
  --nl-orange: #f89a39;       /* "LAB" */
  --nl-orange-deep: #d97a16;
  --nl-orange-text: #a85a0b;  /* orange that passes AA on white */
  --nl-orange-tint: #fef1e1;
  --nl-mint: #eef5f0;         /* soft section background */
  --nl-ink: #1c2b24;          /* body text */
  --nl-muted: #5b6b63;
  --nl-line: rgba(22, 83, 58, 0.12);

  /* Type */
  --nl-font: "Noto Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base type ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--nl-font);
  color: var(--nl-ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Hindi text keeps the Devanagari cut of the same family */
:lang(hi),
[lang="hi"] {
  font-family: "Noto Sans Devanagari", "Noto Sans", system-ui, sans-serif;
}

body,
button,
input,
select,
textarea {
  font-family: var(--nl-font);
}

/* Old styles forced wide tracking on headings; Noto Sans reads best at normal spacing */
h1, h2, h3, h4, h5, h6,
.certified-title,
.product-title,
.site-shadow-heading {
  letter-spacing: -0.005em;
}

/* ---------- Brand colour hooks ---------- */
::selection {
  background: var(--nl-leaf-tint);
  color: var(--nl-green-deep);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--nl-orange);
  outline-offset: 2px;
}

.certified-title-line {
  background: linear-gradient(90deg, var(--nl-green) 0%, var(--nl-leaf) 55%, var(--nl-orange) 100%) !important;
}

/* Discount pill: white text needs the deep orange, not the light logo orange */
.product-badge--pct {
  background: linear-gradient(145deg, #e8861f 0%, #c9690f 55%, #a85a0b 100%) !important;
  color: #fff !important;
}

/* Struck-through MRP stays readable */
.original-price {
  color: #6b7a72;
}

/* ---------- Layout safety (all pages) ---------- */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

/* Long product names, URLs and Hindi compounds wrap instead of pushing the layout */
p, li, dd, td, th,
h1, h2, h3, h4, h5, h6,
.product-title,
.product-title-link {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Wide content scrolls inside itself, never the page */
table {
  max-width: 100%;
}

/* Admin/CKEditor content (blog body, PDP rich blocks) often carries fixed
   pixel widths — keep it inside the screen without changing the content */
.content-main img,
.pdp-below-html__body img {
  max-width: 100% !important;
  height: auto !important;
}

.content-main table,
.pdp-below-html__body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.content-main iframe,
.content-main video,
.pdp-below-html__body iframe,
.pdp-below-html__body video {
  max-width: 100% !important;
}

.content-main pre,
.pdp-below-html__body pre {
  white-space: pre-wrap;
}

.content-main [style*="width"],
.pdp-below-html__body [style*="width"] {
  max-width: 100% !important;
  box-sizing: border-box;
}

/* ---------- Product cards: no ghosted double image ---------- */
/* The second photo now slides in ON TOP of the first with a solid backdrop,
   so two transparent PNG/WebP packshots never show through each other. */
.product-card .default-img {
  opacity: 1 !important;
  z-index: 1;
}

.product-card .hover-img {
  opacity: 0;
  z-index: 2;
  background-color: #eef2ef;
  transition: opacity 0.12s linear;
}

.products-section--pro .products-grid .hover-img {
  background-color: #e8ece9;
}

.product-card:hover .default-img {
  opacity: 1 !important;
}

.product-card:hover .hover-img {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover .hover-img {
    opacity: 1;
  }
}

/* Touch screens: a tap must not leave a half-swapped image behind */
@media (hover: none), (pointer: coarse) {
  .product-card .hover-img {
    display: none !important;
  }
}

/* Equal-height cards: price + buttons line up across a row */
.products-grid .product-card {
  display: flex;
  flex-direction: column;
}

.products-grid .product-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.products-grid .product-card-body .product-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: calc(2em * 1.35);
  line-height: 1.35;
}

.products-grid .product-qty-cart-row {
  margin-top: auto;
}

/* Add-to-cart label never spills out of its button */
.add-to-cart--body {
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}

.add-to-cart--body .add-to-cart-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Very narrow phones (≤ 360px): give buttons room */
@media (max-width: 360px) {
  .products-section--pro .products-grid {
    gap: 0.55rem 0.45rem !important;
  }

  .products-section--pro .products-grid .add-to-cart-icon {
    display: none;
  }
}

/* ---------- Header / marquee ---------- */
.site-marquee .site-marquee-inner {
  letter-spacing: 0.12em;
}

@media (max-width: 767.98px) {
  .header-mobile .custom-header-logo img {
    max-width: 118px;
    height: auto;
    max-height: 44px;
  }

  .header-search-input {
    min-width: 0;
    font-size: 16px; /* stops iOS zooming into the search box */
  }
}

/* ---------- Footer: tidy stacking on phones ---------- */
@media (max-width: 767.98px) {
  .footer-app-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .footer-app-badge {
    flex: 0 1 calc(50% - 0.25rem);
    min-width: 0;
  }

  .footer-app-badge-img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .footer-newsletter-input {
    min-width: 0;
    font-size: 16px; /* stops iOS zoom on focus */
  }

  .footer-link-list a,
  .footer-col a {
    display: inline-block;
    padding-block: 0.2rem; /* bigger tap targets */
  }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none !important;
  }

  .product-card,
  .product-card:hover {
    transform: none !important;
    transition: none !important;
  }
}

/* ---------- Readability (WCAG AA contrast) ---------- */
/* PDP "Add to Cart": logo orange with dark text (like Amazon's yellow button),
   white text on orange was only 2.6:1 */
.pdp-cta-row-main .pdp-add-cart {
  background: var(--nl-orange) !important;
  border-color: var(--nl-orange-deep) !important;
  color: var(--nl-ink) !important;
}

.pdp-cta-row-main .pdp-add-cart:hover {
  background: #f9a752 !important;
}

.pdp-cta-row-main .pdp-add-cart * {
  color: inherit;
}

/* Cart / wishlist counters on the orange dot */
.header-count-badge {
  color: var(--nl-ink) !important;
}

.product-category-line {
  color: var(--nl-muted) !important;
}

.product-price .discount,
.discount {
  color: #6e4f0c;
}

.pdp-reviews__time {
  color: #64748b !important;
}

/* "Certified" pill on PDP (text-[#b8620f] on gold tint was 3.7:1) */
.bg-goldlight.text-\[\#b8620f\] {
  color: #8a4a08 !important;
}
