/* DIVYAM visual foundation
   Semantic tokens and shared public-facing components. Keep this file last in the
   public stylesheet order so legacy page CSS can be retired incrementally. */

:root {
  color-scheme: light;

  /* Sacred colour system */
  --divyam-maroon: #4a1018;
  --divyam-maroon-hover: #611926;
  --divyam-maroon-deep: #2a080e;
  --divyam-ivory: #faf6ee;
  --divyam-sandal: #f2e8d8;
  --divyam-surface: #fffdf8;
  --divyam-surface-muted: #f6efe4;
  --divyam-gold: #a67f3f;
  --divyam-gold-strong: #876128;
  --divyam-gold-soft: #d7bd88;
  --divyam-saffron: #b96625;
  --divyam-ink: #28231e;
  --divyam-muted: #675e55;
  --divyam-border: rgba(74, 16, 24, 0.18);
  --divyam-border-gold: rgba(166, 127, 63, 0.42);
  --divyam-danger: #9d2f32;
  --divyam-focus: #8a4b16;

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Noto Serif Devanagari', Georgia, serif;
  --font-body: Manrope, 'Noto Sans Devanagari', 'Nirmala UI', system-ui, sans-serif;
  --font-h1: clamp(3rem, 7vw, 6.25rem);
  --font-h2: clamp(2.2rem, 4.5vw, 4rem);
  --font-h3: clamp(1.4rem, 2.1vw, 1.85rem);
  --font-h4: clamp(1.05rem, 1.3vw, 1.2rem);
  --font-body-size: clamp(1rem, 0.96rem + 0.15vw, 1.08rem);
  --font-small: 0.82rem;
  --font-eyebrow: 0.72rem;

  /* Spacing and layout */
  --space-2xs: 0.25rem;
  --space-xs: clamp(0.5rem, 0.45rem + 0.2vw, 0.625rem);
  --space-sm: clamp(0.75rem, 0.68rem + 0.3vw, 0.95rem);
  --space-md: clamp(1rem, 0.88rem + 0.45vw, 1.25rem);
  --space-lg: clamp(1.4rem, 1.15rem + 0.8vw, 1.9rem);
  --space-xl: clamp(2rem, 1.45rem + 1.8vw, 3rem);
  --space-2xl: clamp(3rem, 2rem + 3.2vw, 5rem);
  --space-section: clamp(4rem, 2.7rem + 4.5vw, 7.5rem);
  --page-gutter: clamp(1rem, 3vw, 3rem);
  --container-reading: 46rem;
  --container-standard: 76rem;
  --container-wide: 90rem;

  /* Shape, depth, and motion */
  --radius-sm: 0.4rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.1rem;
  --shadow-soft: 0 0.8rem 2.4rem rgba(53, 26, 17, 0.07);
  --shadow-raised: 0 1rem 2.8rem rgba(53, 26, 17, 0.11);
  --transition-fast: 150ms ease;
  --transition-calm: 240ms ease;

  /* Compatibility aliases while legacy rules are retired. */
  --shubh-maroon: var(--divyam-maroon);
  --shubh-maroon-deep: var(--divyam-maroon-deep);
  --shubh-saffron: var(--divyam-saffron);
  --shubh-gold: var(--divyam-gold);
  --shubh-gold-soft: var(--divyam-gold-soft);
  --shubh-sand: var(--divyam-sandal);
  --shubh-ivory: var(--divyam-ivory);
  --shubh-paper: var(--divyam-sandal);
  --shubh-ink: var(--divyam-ink);
  --shubh-muted: var(--divyam-muted);
  --shubh-teal: #335f59;
  --shubh-line: var(--divyam-border);
  --shubh-serif: var(--font-display);
  --shubh-sans: var(--font-body);
}

html {
  scroll-padding-top: 7rem;
}

body:has(.storefront-shell),
body:has(.site-header),
body:has(.bhakti-header) {
  min-width: 0;
  overflow-x: clip;
  background: var(--divyam-ivory);
  color: var(--divyam-ink);
  font-family: var(--font-body);
  font-size: var(--font-body-size);
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

.storefront-shell {
  min-width: 0;
  background:
    radial-gradient(circle at 50% -8rem, rgba(215, 189, 136, 0.22), transparent 30rem),
    var(--divyam-ivory);
  color: var(--divyam-ink);
}

.storefront-shell :is(h1, h2, h3, h4),
body:has(.site-header) :is(h1, h2, h3, h4),
body:has(.bhakti-header) :is(h1, h2, h3, h4) {
  color: var(--divyam-maroon);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.storefront-shell h1,
body:has(.site-header) h1,
.bhakti-hero h1 {
  font-size: var(--font-h1);
  line-height: 0.96;
}

.storefront-shell h2,
body:has(.site-header) h2,
body:has(.bhakti-header) h2 {
  font-size: var(--font-h2);
  line-height: 1.02;
}

.storefront-shell h3,
body:has(.site-header) h3,
body:has(.bhakti-header) h3 {
  font-size: var(--font-h3);
  line-height: 1.15;
}

.storefront-shell h4,
body:has(.site-header) h4,
body:has(.bhakti-header) h4 {
  font-size: var(--font-h4);
  line-height: 1.3;
}

:lang(hi),
:lang(sa) {
  font-family: 'Noto Sans Devanagari', 'Nirmala UI', Mangal, var(--font-body);
}

:lang(hi) :is(h1, h2, h3, h4),
:lang(sa) :is(h1, h2, h3, h4) {
  font-family: 'Noto Serif Devanagari', 'Nirmala UI', Mangal, serif;
  line-height: 1.2;
}

.storefront-shell :is(p, li),
body:has(.site-header) :is(p, li),
body:has(.bhakti-header) :is(p, li) {
  color: var(--divyam-muted);
}

.storefront-shell small,
body:has(.site-header) small,
body:has(.bhakti-header) small {
  font-size: var(--font-small);
  line-height: 1.55;
}

.storefront-shell .eyebrow,
body:has(.site-header) .eyebrow,
.library-intro .label,
.guide-title > p,
.editorial-promise .label {
  color: var(--divyam-gold-strong);
  font-family: var(--font-body);
  font-size: var(--font-eyebrow);
  font-weight: 800;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.guide-note,
blockquote,
.shloka {
  border-inline-start: 2px solid var(--divyam-gold);
  color: var(--divyam-maroon);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  font-style: normal;
  line-height: 1.65;
}

/* Consistent page rhythm and containers */
.storefront-shell .section {
  width: min(100%, calc(var(--container-wide) + (2 * var(--page-gutter))));
  margin-inline: auto;
  padding: var(--space-section) var(--page-gutter);
}

.storefront-shell .center-heading,
.storefront-shell .newsletter > :is(h2, p, form, small),
.library-intro,
.guide-body {
  max-width: var(--container-reading);
}

.storefront-shell :is(.collection-cards, .product-grid, .help-grid, .trust-strip),
.promise-grid {
  gap: var(--space-lg);
}

.storefront-shell :is(.collection-cards, .product-grid) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
}

/* Restrained sacred geometry: a hairline, central bindu, and quiet arch corners. */
.storefront-shell :is(.center-heading, .product-head)::after,
.library-intro > div::after,
.editorial-promise > div:first-child::after {
  display: block;
  width: 5.5rem;
  height: 0.45rem;
  margin-top: var(--space-md);
  content: '';
  background:
    radial-gradient(circle, var(--divyam-gold) 0 0.2rem, transparent 0.22rem),
    linear-gradient(var(--divyam-gold-soft), var(--divyam-gold-soft)) center / 100% 1px no-repeat;
}

.storefront-shell .center-heading::after {
  margin-inline: auto;
}

/* Header foundation */
.storefront-shell .shipping-bar {
  min-height: 2rem;
  padding: 0.42rem var(--page-gutter);
  border-top: 2px solid var(--divyam-gold);
  background: var(--divyam-maroon-deep);
  color: var(--divyam-ivory);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.35;
}

.storefront-shell .lux-header,
body:has(.site-header) .site-header,
.bhakti-header {
  border-bottom: 1px solid var(--divyam-border-gold);
  background: rgba(42, 8, 14, 0.97);
  box-shadow: 0 0.5rem 1.8rem rgba(42, 8, 14, 0.1);
}

.storefront-shell .lux-header {
  min-height: 5rem;
  padding: var(--space-sm) var(--page-gutter);
}

.storefront-shell .lux-logo img,
.bhakti-brand img {
  border: 1px solid rgba(215, 189, 136, 0.34);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.storefront-shell .lux-logo img {
  width: min(9.5rem, 38vw);
}

.storefront-shell .lux-nav {
  gap: 0.15rem clamp(0.8rem, 1.7vw, 1.5rem);
  color: rgba(250, 246, 238, 0.88);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.storefront-shell .lux-nav a,
.bhakti-header nav a,
body:has(.site-header) .menu-panel a {
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.storefront-shell .lux-nav a:hover,
.storefront-shell .lux-nav a:focus-visible,
.bhakti-header nav a:hover,
.bhakti-header nav a:focus-visible,
body:has(.site-header) .menu-panel a:hover,
body:has(.site-header) .menu-panel a:focus-visible {
  color: var(--divyam-gold-soft);
}

.storefront-shell .search-pill {
  min-height: 2.75rem;
  border: 1px solid rgba(215, 189, 136, 0.34);
  border-radius: var(--radius-sm);
  background: rgba(250, 246, 238, 0.08);
}

.storefront-shell .mobile-nav-toggle {
  min-width: 4.25rem;
  min-height: 2.75rem;
  border-radius: var(--radius-sm);
}

/* Buttons and interactive states */
.storefront-shell :is(.button, .add-button, .buy-button, .status-link, .icon-button),
body:has(.site-header) :is(.button, .header-buy),
.bhakti-hero a,
.guide-body > a {
  min-height: 2.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  line-height: 1.2;
  text-transform: uppercase;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-calm),
    transform var(--transition-fast);
}

.storefront-shell :is(.button.maroon, .button.primary, .add-button, .buy-button, .status-link),
body:has(.site-header) :is(.button.primary, .header-buy),
.bhakti-hero a {
  border: 1px solid var(--divyam-maroon);
  background: var(--divyam-maroon);
  color: var(--divyam-ivory);
  box-shadow: none;
}

.storefront-shell :is(.button.maroon, .button.primary, .add-button, .buy-button, .status-link):hover,
body:has(.site-header) :is(.button.primary, .header-buy):hover,
.bhakti-hero a:hover {
  border-color: var(--divyam-maroon-hover);
  background: var(--divyam-maroon-hover);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.storefront-shell :is(.button.outline, .segment-tab, .remove-cart-item),
body:has(.site-header) .button.outline,
.guide-body > a {
  border: 1px solid rgba(74, 16, 24, 0.42);
  background: var(--divyam-surface);
  color: var(--divyam-maroon);
  box-shadow: none;
}

.storefront-shell :is(.button.outline, .segment-tab, .remove-cart-item):hover,
body:has(.site-header) .button.outline:hover,
.guide-body > a:hover {
  border-color: var(--divyam-maroon);
  background: var(--divyam-surface-muted);
  transform: translateY(-1px);
}

.storefront-shell .button.sacred {
  border: 1px solid var(--divyam-gold-strong);
  background: var(--divyam-gold-strong);
  color: var(--divyam-surface);
}

.storefront-shell :is(button, .button, a):active,
body:has(.site-header) :is(button, .button, a):active,
body:has(.bhakti-header) :is(button, a):active {
  transform: translateY(0);
}

.storefront-shell :is(button, .button, input, select, textarea):disabled,
.storefront-shell :is(button, .button)[aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.storefront-shell :is(button, .button)[aria-busy='true'],
.storefront-shell :is(button, .button).is-loading {
  cursor: wait;
  opacity: 0.76;
}

.storefront-shell :is(button, .button)[aria-busy='true']::after,
.storefront-shell :is(button, .button).is-loading::after {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-inline-start: 0.55rem;
  border: 1px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: '';
  animation: divyam-spin 700ms linear infinite;
}

/* Cards and future ecommerce surfaces */
.storefront-shell :is(
  .collection-card,
  .product-card,
  .help-card,
  .trust-strip article,
  .cart-panel,
  .catalogue-login-card,
  .saved-product,
  .tracking-card
),
body:has(.site-header) .category-products .product-card,
.promise-grid article,
.guide-body {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--divyam-border-gold);
  border-radius: var(--radius-md);
  background: var(--divyam-surface);
  box-shadow: var(--shadow-soft);
}

.storefront-shell :is(.collection-card, .product-card, .help-card, .trust-strip article)::after,
body:has(.site-header) .category-products .product-card::after,
.promise-grid article::after {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 1.8rem;
  height: 1.8rem;
  border-top: 1px solid var(--divyam-gold-soft);
  border-right: 1px solid var(--divyam-gold-soft);
  border-radius: 0 1.4rem 0 0;
  content: '';
  opacity: 0.62;
  pointer-events: none;
}

.storefront-shell :is(a.collection-card, .product-card, .help-card),
.promise-grid article {
  transition: border-color var(--transition-calm), box-shadow var(--transition-calm), transform var(--transition-calm);
}

.storefront-shell :is(a.collection-card, .product-card, .help-card):hover,
.storefront-shell :is(a.collection-card, .product-card, .help-card):focus-within {
  border-color: rgba(166, 127, 63, 0.7);
  box-shadow: var(--shadow-raised);
  transform: translateY(-0.2rem);
}

.storefront-shell :is(.collection-art, .product-visual),
body:has(.site-header) .product-art {
  border-radius: calc(var(--radius-md) - 0.15rem);
  background-color: var(--divyam-surface-muted);
}

/* Forms */
.storefront-shell :is(input, select, textarea),
body:has(.site-header) :is(input, select, textarea),
body:has(.bhakti-header) :is(input, select, textarea) {
  min-height: 2.75rem;
  border: 1px solid var(--divyam-border-gold);
  border-radius: var(--radius-sm);
  background: var(--divyam-surface);
  color: var(--divyam-ink);
}

.storefront-shell .search-pill input::placeholder,
.storefront-shell :is(input, textarea)::placeholder,
body:has(.site-header) :is(input, textarea)::placeholder,
body:has(.bhakti-header) :is(input, textarea)::placeholder {
  color: #756d64;
  opacity: 1;
}

.storefront-shell :is(a, button, input, select, textarea):focus-visible,
body:has(.site-header) :is(a, button, input, select, textarea):focus-visible,
body:has(.bhakti-header) :is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--divyam-focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--divyam-surface);
  color: var(--divyam-maroon);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Calm hero and content surfaces */
.storefront-shell .lux-hero {
  border-bottom: 1px solid var(--divyam-border-gold);
  background: var(--divyam-ivory);
}

.storefront-shell .lux-hero::before {
  background:
    radial-gradient(circle at 16% 18%, rgba(185, 102, 37, 0.06), transparent 18rem),
    linear-gradient(90deg, rgba(166, 127, 63, 0.08), transparent 30%);
}

.storefront-shell .lux-hero h1 {
  color: var(--divyam-maroon);
  font-size: var(--font-h1);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.94;
  text-shadow: none;
}

.storefront-shell .lux-hero p:not(.eyebrow) {
  color: var(--divyam-muted);
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.7;
}

.storefront-shell :is(.catalogue-hero, .home-finder-section, .lux-benefits) {
  border-color: var(--divyam-border-gold);
  background: var(--divyam-surface-muted);
}

/* Footer foundation */
.storefront-shell .lux-footer,
.bhakti-footer,
body:has(.site-header) footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--divyam-border-gold);
  background: var(--divyam-maroon-deep);
  color: rgba(250, 246, 238, 0.82);
}

.storefront-shell .lux-footer::before,
.bhakti-footer::before,
body:has(.site-header) footer::before {
  display: block;
  width: 100%;
  height: 0.3rem;
  content: '';
  background:
    radial-gradient(circle, var(--divyam-gold-soft) 0 1px, transparent 1.5px) 0 0 / 0.8rem 0.3rem,
    var(--divyam-maroon);
  opacity: 0.72;
}

.storefront-shell .footer-grid,
.bhakti-footer {
  width: min(100%, var(--container-wide));
  margin-inline: auto;
}

.storefront-shell .footer-grid {
  gap: var(--space-xl);
  padding: var(--space-2xl) var(--page-gutter);
}

.storefront-shell .footer-grid h3,
.bhakti-footer h3 {
  color: var(--divyam-surface);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.storefront-shell .footer-grid :is(p, a),
.bhakti-footer :is(p, a),
body:has(.site-header) footer {
  color: rgba(250, 246, 238, 0.72);
}

.storefront-shell .footer-grid a,
.bhakti-footer a {
  text-decoration-color: transparent;
  text-underline-offset: 0.25em;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.storefront-shell .footer-grid a:hover,
.storefront-shell .footer-grid a:focus-visible,
.bhakti-footer a:hover,
.bhakti-footer a:focus-visible {
  color: var(--divyam-gold-soft);
  text-decoration-color: currentColor;
}

.storefront-shell .footer-perks {
  border-bottom: 1px solid rgba(215, 189, 136, 0.22);
  background: transparent;
}

.storefront-shell .footer-perks span {
  padding: var(--space-lg) var(--page-gutter);
  background: var(--divyam-maroon);
  color: var(--divyam-ivory);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.storefront-shell .footer-logo {
  min-height: 0;
  place-items: start;
  border-radius: var(--radius-sm);
  background: transparent;
}

.storefront-shell .footer-logo img {
  width: min(11rem, 60vw);
  border: 1px solid rgba(215, 189, 136, 0.3);
  box-shadow: none;
}

/* Bhakti shares the same foundation while retaining its editorial character. */
.bhakti-header {
  top: 0;
  z-index: 50;
  padding: var(--space-sm) var(--page-gutter);
}

.bhakti-header nav {
  gap: var(--space-md);
}

.bhakti-header nav a {
  color: rgba(250, 246, 238, 0.86);
}

.bhakti-hero {
  min-height: clamp(28rem, 62vh, 44rem);
  border-bottom: 1px solid var(--divyam-border-gold);
}

body:has(.bhakti-header) .bhakti-hero h1 {
  color: var(--divyam-ivory);
  text-shadow: 0 0.12rem 1rem rgba(20, 6, 8, 0.3);
}

body:has(.bhakti-header) .bhakti-hero p {
  color: var(--divyam-gold-soft);
  text-shadow: 0 0.08rem 0.55rem rgba(20, 6, 8, 0.78);
}

body:has(.bhakti-header) .bhakti-hero span {
  color: var(--divyam-ivory);
}

.library-intro,
.guide,
.editorial-promise {
  width: min(100%, var(--container-standard));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.guide-body,
.promise-grid article {
  padding: var(--space-xl);
}

.bhakti-footer {
  padding: var(--space-2xl) var(--page-gutter);
}

@keyframes divyam-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1024px) {
  .storefront-shell .section {
    padding-block: clamp(3.5rem, 7vw, 5.5rem);
  }

  .storefront-shell .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-top: 5.5rem;
  }

  .storefront-shell .lux-header {
    padding: 0.7rem var(--page-gutter);
  }

  .storefront-shell .lux-header.nav-open .lux-nav {
    gap: 0.45rem;
  }

  .storefront-shell .lux-nav a {
    min-height: 2.75rem;
    padding: 0.65rem 0.7rem;
    border: 1px solid rgba(215, 189, 136, 0.23);
    background: rgba(250, 246, 238, 0.04);
  }

  .storefront-shell .header-tools {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .storefront-shell .lux-hero-copy {
    padding: var(--space-2xl) var(--page-gutter);
  }

  .storefront-shell .lux-hero h1 {
    font-size: clamp(3rem, 13.5vw, 4.4rem);
    line-height: 0.96;
  }

  .bhakti-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .bhakti-header nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .bhakti-header nav a {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid rgba(215, 189, 136, 0.22);
  }

  .guide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  :root {
    --page-gutter: clamp(1rem, 4.5vw, 1.25rem);
  }

  .storefront-shell .section {
    padding-block: 3.75rem;
  }

  .storefront-shell :is(.button, .add-button, .buy-button, .status-link),
  body:has(.site-header) :is(.button, .header-buy) {
    min-height: 2.85rem;
  }

  .storefront-shell :is(.collection-cards, .product-grid, .help-grid, .trust-strip),
  .promise-grid,
  .storefront-shell .footer-grid,
  .storefront-shell .footer-perks {
    grid-template-columns: 1fr;
  }

  .storefront-shell .lux-logo img {
    width: min(8.5rem, 42vw);
  }

  .storefront-shell .header-tools {
    grid-template-columns: minmax(0, 1fr) repeat(2, auto);
  }

  .storefront-shell .header-tools :is(.button, .icon-button) {
    min-width: 0;
    padding-inline: 0.65rem;
  }

  .guide-body,
  .promise-grid article {
    padding: var(--space-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .storefront-shell :is(.collection-card, .product-card, .help-card),
  .promise-grid article {
    border: 1px solid CanvasText;
  }
}
