/* ================================================================
   Prakash Marg — custom.css
   Fixes ALL broken Tailwind dark: variant classes.
   The compiled style.css has malformed .dark selectors,
   so every dark: class is manually implemented here.
   ================================================================ */

/* ----------------------------------------------------------------
   BASE SETUP
   ---------------------------------------------------------------- */
html { scroll-behavior: smooth; }

:root {
    --cream:      #FFFDF9;
    --darkbrown:  #3D2B1F;
    --saffron:    #FF9933;
    --navy:       #0f172a;
    --navy-light: #1e293b;
    --gold:       #fbbf24;
}

/* ----------------------------------------------------------------
   SCREEN READER UTILITY
   ---------------------------------------------------------------- */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

/* ----------------------------------------------------------------
   DARK MODE — GLOBAL FOUNDATION
   When .dark is on <html>, flip the entire page
   ---------------------------------------------------------------- */
.dark body {
    background-color: #0f172a;
    color: #FFFDF9;
}

/* ----------------------------------------------------------------
   DARK MODE — BACKGROUNDS
   ---------------------------------------------------------------- */

/* bg-navy = dark page background */
.dark .dark\:bg-navy       { background-color: #0f172a !important; }
.dark .dark\:bg-navy-dark  { background-color: #020617 !important; }
.dark .dark\:bg-navy-light { background-color: #1e293b !important; }
.dark .dark\:bg-navy\/90   { background-color: rgba(15,23,42,0.9) !important; }
.dark .dark\:bg-cream      { background-color: #FFFDF9 !important; }
.dark .dark\:bg-saffron-dark { background-color: #E67A00 !important; }

/* Standard Tailwind color overrides for dark mode */
/* bg-white cards → navy-light */
.dark .bg-white            { background-color: #1e293b !important; }

/* bg-cream content areas → navy */
.dark .bg-cream            { background-color: #0f172a !important; }
.dark .bg-cream\/90        { background-color: rgba(15,23,42,0.9) !important; }

/* Header sticky bg — covers bg-cream/90 backdrop header */
.dark header,
.dark header.sticky        { background-color: rgba(15,23,42,0.95) !important; border-color: rgba(255,153,51,0.12) !important; }

/* Sections that alternate between bg-cream and bg-white */
.dark section.bg-cream,
.dark section.bg-white,
.dark section              { background-color: #0f172a; }
.dark section.bg-white     { background-color: #1e293b !important; }

/* ----------------------------------------------------------------
   DARK MODE — TEXT
   ---------------------------------------------------------------- */
.dark .dark\:text-cream       { color: #FFFDF9 !important; }
.dark .dark\:text-cream-light { color: rgba(255,253,249,0.75) !important; }
.dark .dark\:text-cream\/70   { color: rgba(255,253,249,0.70) !important; }
.dark .dark\:text-gold        { color: #fbbf24 !important; }
.dark .dark\:text-saffron     { color: #FF9933 !important; }
.dark .dark\:text-white       { color: #ffffff !important; }
.dark .dark\:text-darkbrown   { color: #3D2B1F !important; }

/* The most common pattern: text-darkbrown on cards */
.dark .text-darkbrown       { color: #FFFDF9 !important; }
.dark .text-darkbrown-light { color: rgba(255,253,249,0.85) !important; }
.dark .text-darkbrown\/80   { color: rgba(255,253,249,0.80) !important; }
.dark .text-darkbrown\/50   { color: rgba(255,253,249,0.50) !important; }

/* ----------------------------------------------------------------
   DARK MODE — BORDERS
   ---------------------------------------------------------------- */
.dark .border-sandalwood\/30 { border-color: rgba(255,153,51,0.14) !important; }
.dark .border-sandalwood\/20 { border-color: rgba(255,153,51,0.10) !important; }
.dark .border-sandalwood\/10 { border-color: rgba(255,153,51,0.07) !important; }
.dark .border-cream\/10      { border-color: rgba(255,253,249,0.10) !important; }
.dark .border-saffron\/20    { border-color: rgba(255,153,51,0.20) !important; }
.dark .border-saffron\/30    { border-color: rgba(255,153,51,0.30) !important; }

/* ----------------------------------------------------------------
   DARK MODE — INPUTS
   ---------------------------------------------------------------- */
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="date"],
.dark input[type="search"],
.dark textarea,
.dark select {
    background-color: #0f172a !important;
    color: #FFFDF9 !important;
    border-color: rgba(255,153,51,0.25) !important;
}
.dark input::placeholder,
.dark textarea::placeholder { color: rgba(255,253,249,0.4) !important; }

/* ----------------------------------------------------------------
   DARK MODE — NAVIGATION
   ---------------------------------------------------------------- */
.dark nav a               { color: #FFFDF9; }
.dark nav a:hover         { color: #FF9933; }

/* Dropdown menu */
.dark .group:hover .absolute > div,
.dark nav .absolute > div {
    background-color: #1e293b;
    border-color: rgba(255,153,51,0.15);
}
.dark nav .absolute a     { color: #FFFDF9; }
.dark nav .absolute a:hover { color: #FF9933; background-color: rgba(255,153,51,0.1); }

/* Mobile menu */
.dark #mobile-menu {
    background-color: #1e293b;
    border-color: rgba(255,153,51,0.1);
}
.dark #mobile-menu a { color: #FFFDF9; }

/* ----------------------------------------------------------------
   DARK MODE — CARDS (article, product, tool, chalisa)
   ---------------------------------------------------------------- */
.dark article,
.dark .panchang-widget     { background-color: #1e293b !important; }

/* ----------------------------------------------------------------
   DARK MODE — SPECIFIC COMPONENTS
   ---------------------------------------------------------------- */

/* Chalisa frame */
.dark .chalisa-frame {
    background: linear-gradient(135deg, #1a2035 0%, #1e293b 100%) !important;
}

/* Panchang widget */
.dark .panchang-widget {
    background-color: #0f172a !important;
    border-color: rgba(255,153,51,0.25) !important;
}

/* Red disclaimer / info boxes */
.dark .bg-red-50 {
    background-color: rgba(127,29,29,0.15) !important;
    border-color: rgba(153,27,27,0.3) !important;
}
.dark .bg-red-50\/80 {
    background-color: rgba(127,29,29,0.12) !important;
}
.dark .text-red-800 { color: #fca5a5 !important; }
.dark .border-red-800\/20 { border-color: rgba(252,165,165,0.2) !important; }

/* Sandalwood/cream tinted backgrounds */
.dark .bg-sandalwood\/20  { background-color: rgba(255,153,51,0.08) !important; }
.dark .bg-cream-dark\/20  { background-color: rgba(30,41,59,0.3) !important; }
.dark .bg-saffron-light\/10 { background-color: rgba(255,153,51,0.08) !important; }

/* White overlays on images */
.dark .bg-white\/90       { background-color: rgba(30,41,59,0.92) !important; }
.dark .bg-white\/50       { background-color: rgba(30,41,59,0.5) !important; }
.dark .bg-white\/10       { background-color: rgba(255,255,255,0.07) !important; }

/* Shadow-inner (buttons in cards) */
.dark .shadow-inner       { box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.4) !important; }

/* ----------------------------------------------------------------
   DARK MODE — THEME TOGGLE BUTTON
   ---------------------------------------------------------------- */
.dark #theme-toggle { background-color: #1e293b; color: #fbbf24; }

/* ----------------------------------------------------------------
   ANIMATIONS & UTILITIES
   ---------------------------------------------------------------- */
.fade-in-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-up.visible { opacity: 1; transform: translateY(0); }

.active-timer {
    border-color: #ff9933 !important;
    background-color: rgba(255,153,51,0.12) !important;
    color: #ff9933 !important;
    font-weight: 700;
}

.tabular-nums { font-variant-numeric: tabular-nums; }
.faq-answer   { overflow: hidden; }

/* ----------------------------------------------------------------
   CUSTOM SCROLLBAR
   ---------------------------------------------------------------- */
::-webkit-scrollbar       { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255,153,51,0.05); }
::-webkit-scrollbar-thumb { background: rgba(255,153,51,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,153,51,0.6); }

/* ----------------------------------------------------------------
   INTERACTIVE ELEMENTS
   ---------------------------------------------------------------- */
#back-to-top:hover        { transform: translateY(-2px) !important; }
#mala-tap-btn:active      { transform: scale(0.93) !important; }

/* ----------------------------------------------------------------
   SEARCH MODAL
   ---------------------------------------------------------------- */
#search-modal             { animation: fadeInModal 0.2s ease; }
.dark #search-modal .bg-white { background-color: #1e293b !important; }
.dark #search-modal .text-darkbrown { color: #FFFDF9 !important; }
.dark #search-modal input  { background-color: #0f172a !important; color: #FFFDF9 !important; }
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

/* ----------------------------------------------------------------
   PROSE OVERRIDES — single.html article content
   ---------------------------------------------------------------- */
.prose h2 {
    font-family: 'Tiro Devanagari Hindi', serif;
    color: #3d2b1f;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(227,193,133,0.3);
}
.dark .prose h2  { color: #FFFDF9; border-color: rgba(255,153,51,0.2); }

.prose p {
    margin-bottom: 1.25rem;
    font-family: Mukta, sans-serif;
    color: rgba(61,43,31,0.9);
    line-height: 1.8;
}
.dark .prose p   { color: rgba(255,253,249,0.85); }

.prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.5rem; }
.prose ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 1.5rem; }
.prose li {
    margin-bottom: 0.5rem;
    font-family: Mukta, sans-serif;
    color: rgba(61,43,31,0.9);
}
.dark .prose li  { color: rgba(255,253,249,0.85); }

/* ----------------------------------------------------------------
   CHALISA FRAME
   ---------------------------------------------------------------- */
.chalisa-frame {
    background: linear-gradient(135deg, #fff8f2 0%, #fff3e8 100%);
}

/* ----------------------------------------------------------------
   FOCUS RINGS
   ---------------------------------------------------------------- */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #ff9933;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ----------------------------------------------------------------
   HOVER BORDER FIX
   ---------------------------------------------------------------- */
.hover\:border-saffron:hover { border-color: #ff9933 !important; }

/* ================================================================
   MASTER UNIFIED NAVIGATION & HEADER STYLES
   Ensures 100% uniformity across all pages, fixes cursor hover bridge,
   and guarantees submenus never disappear prematurely.
   ================================================================ */
.top-bar {
  background: #7b191c;
  color: #fff;
  font-size: 12px;
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1010;
}
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--bd, #e8dfcf);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.dark .site-header {
  background: #1c0e12;
  border-bottom: 1px solid #3d1c22;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 15px;
}
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.desktop-nav a {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--txm, #5a3e2b);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}
.desktop-nav a:hover,
.desktop-nav a.active {
  color: #7b191c;
  background: #fff5f5;
  font-weight: 700;
}
.dark .desktop-nav a {
  color: #d1c5b8;
}
.dark .desktop-nav a:hover,
.dark .desktop-nav a.active {
  color: #ff9999;
  background: #2d1419;
}
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown > button {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--txm, #5a3e2b);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: all 0.2s;
}
.nav-dropdown:hover > button,
.nav-dropdown > button:hover {
  color: #7b191c;
  background: #fff5f5;
}
.dark .nav-dropdown > button {
  color: #d1c5b8;
}
.dark .nav-dropdown:hover > button {
  color: #ff9999;
  background: #2d1419;
}
.dropdown-menu {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0px;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #e2d6c3;
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(0,0,0,0.12);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 1020;
}
/* Crucial invisible hover bridge: closes the gap between button and dropdown */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}
.dark .dropdown-menu {
  background: #221216;
  border-color: #44222a;
  box-shadow: 0 14px 35px rgba(0,0,0,0.4);
}
.nav-dropdown:hover > .dropdown-menu,
.nav-dropdown:focus-within > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 13px;
  color: #2c1a0e;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  font-weight: 500;
}
.dropdown-menu a:hover {
  background: #fff5f5;
  color: #7b191c;
}
.dark .dropdown-menu a {
  color: #ede8df;
}
.dark .dropdown-menu a:hover {
  background: #2d1419;
  color: #ff9999;
}
@media (max-width: 992px) {
  .desktop-nav { display: none !important; }
}

/* =========================================================
   TOP MARGIN & LAYOUT RESETS (Eliminates Top Blank Space)
   ========================================================= */
html,
body {
  margin: 0 !important;
  padding: 0 !important;
}

.top-bar,
.top-announcement-bar {
  margin-top: 0 !important;
  margin-block-start: 0 !important;
  padding-top: 0 !important;
}

/* =========================================================
   AUTHENTIC VEDIC DARK MODE SYSTEM (Overrides all inline styles)
   ========================================================= */
html.dark {
  color-scheme: dark;
}

html.dark body,
html.dark main {
  background-color: #12090b !important;
  color: #f0e8e0 !important;
}

/* Header & Sticky Navigation */
html.dark .site-header,
html.dark .main-nav-wrap {
  background: #180d10 !important;
  border-bottom: 1px solid #3a2428 !important;
  box-shadow: 0 2px 14px rgba(0,0,0,0.5) !important;
}
html.dark .desktop-nav > a,
html.dark .desktop-nav .nav-dropdown > button,
html.dark .nav-dropdown-btn {
  color: #e2d4cb !important;
}
html.dark .desktop-nav > a:hover,
html.dark .desktop-nav .nav-dropdown > button:hover,
html.dark .nav-dropdown-btn:hover {
  background: #2a1518 !important;
  color: #ffd885 !important;
}
html.dark .desktop-nav > a.active {
  color: #ffd885 !important;
  border-bottom-color: #ffd885 !important;
}

/* Dropdown Menus */
html.dark .dropdown-menu {
  background: #1e1113 !important;
  border: 1px solid #3a2428 !important;
  box-shadow: 0 10px 28px rgba(0,0,0,0.6) !important;
}
html.dark .dropdown-menu a {
  color: #e2d4cb !important;
}
html.dark .dropdown-menu a:hover {
  background: #2a1518 !important;
  color: #ffd885 !important;
}

/* Hero Section in Dark Mode */
html.dark .hero {
  background: linear-gradient(90deg, #1c0e12 0%, #15090b 35%, rgba(21, 9, 11, 0.88) 52%, rgba(21, 9, 11, 0.3) 72%, transparent 100%), url('../images/hero_bg.png') right center / cover no-repeat !important;
  border-bottom-color: #3a2428 !important;
}
html.dark .hero-h1 {
  color: #ffd885 !important;
}
html.dark .hero-sub {
  color: #d8c8bc !important;
}

/* Universal Section & Card Inlines Override */
html.dark div[style*="background: #fff"],
html.dark div[style*="background:#fff"],
html.dark div[style*="background: #ffffff"],
html.dark div[style*="background:#ffffff"],
html.dark div[style*="background: #faf8f5"],
html.dark div[style*="background:#faf8f5"],
html.dark div[style*="background: #fffdf7"],
html.dark div[style*="background:#fffdf7"],
html.dark div[style*="background: #fffcf6"],
html.dark div[style*="background: #fdfaf5"],
html.dark section[style*="background: #fff"],
html.dark section[style*="background: #ffffff"],
html.dark section[style*="background: linear-gradient"],
html.dark article[style*="background"],
html.dark aside[style*="background"],
html.dark .card,
html.dark .tool-card,
html.dark .post-card,
html.dark .bhajan-card,
html.dark .temple-card,
html.dark .sidebar-widget {
  background: #1a0d0f !important;
  border-color: #3a2428 !important;
  color: #f0e8e0 !important;
}

/* Secondary nested cards, boxes & pills */
html.dark div[style*="background: #fff8f0"],
html.dark div[style*="background: #fdf8f5"],
html.dark div[style*="background: #fcf9f2"],
html.dark div[style*="background: #f5efe1"],
html.dark a[style*="background: #fff"],
html.dark a[style*="background: #faf8f5"],
html.dark a[style*="background: #fff8f0"],
html.dark .rashi-btn,
html.dark .deity-tab,
html.dark .quick-pill {
  background: #241318 !important;
  border-color: #3a2428 !important;
  color: #e8ded4 !important;
}

/* Text Overrides */
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6 {
  color: #ffd885 !important;
}
html.dark p, html.dark span:not(.hero-badge):not(#top-tithi-text), html.dark li {
  color: #d8c8bc !important;
}
html.dark p[style*="color: #5a3e2b"],
html.dark p[style*="color: #2c1a0e"],
html.dark span[style*="color: #5a3e2b"],
html.dark span[style*="color: #2c1a0e"],
html.dark div[style*="color: #5a3e2b"],
html.dark div[style*="color: #2c1a0e"] {
  color: #d8c8bc !important;
}
html.dark a[style*="color: #7b191c"],
html.dark a[style*="color: #5a3e2b"] {
  color: #ffd885 !important;
}

/* Inputs, Selects, Search */
html.dark input,
html.dark select,
html.dark textarea {
  background: #221216 !important;
  color: #f0e8e0 !important;
  border-color: #4a282f !important;
}
html.dark input::placeholder {
  color: #8c766b !important;
}
html.dark .header-right button {
  background: #241318 !important;
  border-color: #4a282f !important;
  color: #ffd885 !important;
}
html.dark .search-box {
  background: #1c0e12 !important;
  border-color: #3a2428 !important;
}

/* Footer in Dark Mode */
html.dark footer,
html.dark .site-footer {
  background: #0d0608 !important;
  border-top-color: #3a2428 !important;
}

/* =========================================================
   UNIVERSAL VEDIC DARK MODE OVERRIDES (All Pages, Cards & Banners)
   ========================================================= */

/* All light gradient banners in dark mode become deep sacred Vedic gradients */
html.dark div[style*="linear-gradient(135deg, #fff"],
html.dark div[style*="linear-gradient(135deg,#fff"],
html.dark div[style*="linear-gradient(90deg, #f"],
html.dark div[style*="linear-gradient(90deg,#f"],
html.dark div[style*="radial-gradient(circle"],
html.dark section[style*="linear-gradient(135deg, #fff"],
html.dark div[style*="linear-gradient(135deg, #fffdf8"],
html.dark .pm-shop-wrapper > div:first-child,
html.dark .pm-chalisa-hero,
html.dark .pm-panchang-hero {
  background: linear-gradient(135deg, #1c0e12 0%, #15090b 50%, #1c0e12 100%) !important;
  border-bottom-color: #3a2428 !important;
}

/* All filter buttons, category pills and buttons with light backgrounds */
html.dark button[style*="background: #fff"],
html.dark button[style*="background:#fff"],
html.dark button[style*="background: #ffffff"],
html.dark button[style*="background:#ffffff"],
html.dark .filter-btn:not(.active) {
  background: #241318 !important;
  border-color: #3a2428 !important;
  color: #e8ded4 !important;
}

/* Universal match for all light hex backgrounds in style attributes */
html.dark *[style*="background: #fff"],
html.dark *[style*="background:#fff"],
html.dark *[style*="background: #faf"],
html.dark *[style*="background:#faf"],
html.dark *[style*="background: #fdf"],
html.dark *[style*="background:#fdf"],
html.dark *[style*="background: #fef"],
html.dark *[style*="background:#fef"],
html.dark *[style*="background: #f5f"],
html.dark *[style*="background:#f5f"],
html.dark *[style*="background: #e8f"],
html.dark *[style*="background:#e8f"],
html.dark *[style*="background: #eaf"],
html.dark *[style*="background:#eaf"],
html.dark *[style*="background: #f0f"],
html.dark *[style*="background:#f0f"],
html.dark *[style*="background: #fcf"],
html.dark *[style*="background:#fcf"] {
  background-color: #1a0d0f !important;
  border-color: #3a2428 !important;
}

/* Headings in dark mode turn divine golden */
html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6,
html.dark *[style*="color: #7b191c"],
html.dark *[style*="color:#7b191c"] {
  color: #ffd885 !important;
}

/* Paragraphs, descriptions and body text in dark mode turn soft ivory */
html.dark p,
html.dark li,
html.dark *[style*="color: #5a3e2b"],
html.dark *[style*="color:#5a3e2b"],
html.dark *[style*="color: #7b6555"],
html.dark *[style*="color:#7b6555"],
html.dark *[style*="color: #2c1a0e"],
html.dark *[style*="color:#2c1a0e"] {
  color: #d8c8bc !important;
}

/* =========================================================
   ── COMPREHENSIVE MOBILE RESPONSIVE & MOBILE APP SYSTEM ──
   ========================================================= */

/* Mobile Base & Viewport Overflows */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* ── Breakpoint: Tablets & Small Desktops (<= 991px) ── */
@media (max-width: 991px) {
  .desktop-nav {
    display: none !important;
  }
  #headerSearchForm {
    display: none !important;
  }
  .mob-search-btn {
    display: flex !important;
  }
  .mob-menu-btn {
    display: flex !important;
  }
  .main-nav-wrap .container {
    padding: 8px 14px !important;
    min-height: 58px !important;
  }
  .logo img {
    height: 42px !important;
    width: auto !important;
  }
  .header-right {
    gap: 8px !important;
  }

  /* Two-column layout (70% Left + 30% Sidebar) stacks cleanly on tablets/mobile */
  div[style*="calc(70% - 15px)"],
  div[style*="calc(30% - 15px)"],
  .sidebar-col,
  .main-col {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  div[style*="display: flex; flex-wrap: wrap; gap: 30px"] {
    gap: 32px !important;
  }
}

/* ── Breakpoint: Mobile Phones & Phablets (<= 768px) ── */
@media (max-width: 768px) {
  /* 1. TOP ANNOUNCEMENT BAR */
  .top-announcement-bar,
  .top-bar {
    padding: 0 10px !important;
    height: 36px !important;
    font-size: 11px !important;
    justify-content: space-between !important;
  }
  .top-announcement-bar span[style*="italic"],
  .top-announcement-bar span[style*="0.4"],
  .top-bar span[style*="italic"],
  .top-bar span[style*="0.4"] {
    display: none !important;
  }
  .top-announcement-bar > div:last-child a,
  .top-bar > div:last-child a {
    display: none !important;
  }
  .top-announcement-bar > div:first-child,
  .top-bar > div:first-child {
    gap: 6px !important;
    max-width: calc(100% - 85px) !important;
  }
  #top-tithi-text {
    max-width: 175px !important;
    display: inline-block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    vertical-align: bottom !important;
  }

  /* 2. HERO SECTION */
  .hero {
    padding: 26px 0 34px !important;
    background-position: center right !important;
  }
  .hero .container,
  div[style*="grid-template-columns: 1.1fr 0.9fr"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 0 16px !important;
  }
  .hero-right-col {
    display: none !important;
  }
  .hero-h1 {
    font-size: 32px !important;
    line-height: 1.2 !important;
    margin-bottom: 12px !important;
  }
  .hero-sub {
    font-size: 14px !important;
    margin-bottom: 18px !important;
    line-height: 1.5 !important;
  }
  .hero-badge {
    font-size: 11px !important;
    margin-bottom: 10px !important;
  }
  .hero div[style*="display: flex; gap: 15px; margin-bottom: 30px"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 18px !important;
  }
  .hero div[style*="display: flex; gap: 15px; margin-bottom: 30px"] a {
    padding: 10px 12px !important;
    font-size: 13px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* 3. CIRCULAR CATEGORY ROW -> NATIVE APP HORIZONTAL SCROLL STRIP */
  .quick-row-wrap {
    padding: 14px 0 !important;
    background: #ffffff !important;
  }
  .quick-row-wrap .container,
  div[style*="grid-template-columns: repeat(10, 1fr)"],
  div[style*="grid-template-columns: repeat(10,1fr)"] {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 14px !important;
    padding: 0 16px !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }
  .quick-row-wrap .container::-webkit-scrollbar,
  div[style*="grid-template-columns: repeat(10, 1fr)"]::-webkit-scrollbar {
    display: none !important;
  }
  .quick-row-wrap .cat-pill-item,
  div[style*="grid-template-columns: repeat(10, 1fr)"] > * {
    flex: 0 0 62px !important;
    scroll-snap-align: start !important;
  }
  .cat-icon-circle {
    width: 48px !important;
    height: 48px !important;
  }
  .cat-pill-item span {
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  /* 4. ADVERTISEMENT BANNER */
  div[style*="border-radius: 14px; box-shadow: 0 4px 18px rgba(123,25,28,0.05)"] {
    flex-direction: column !important;
    padding: 16px 14px !important;
    text-align: center !important;
    gap: 12px !important;
  }

  /* 5. CONTENT GRIDS (TRANSFORM FROM 4 DESKTOP COLS TO 2 APP COLS) */
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns: repeat(4,1fr)"],
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  /* 3-column grids -> 1 prominent column */
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns: repeat(3,1fr)"],
  .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* 6-column Rashifal grid -> 3 columns */
  #rashiPillsGrid,
  div[style*="grid-template-columns: repeat(6, 1fr)"],
  div[style*="grid-template-columns: repeat(6,1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  /* 6. CARD DIMENSIONS & TYPOGRAPHY FOR MOBILE SCREENS */
  .chalisa-card div[style*="height: 145px"],
  .chalisa-card div[style*="height:145px"] {
    height: 115px !important;
  }
  .chalisa-card h3 {
    font-size: 14px !important;
    margin-bottom: 4px !important;
  }
  .chalisa-card p {
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .chalisa-card button {
    padding: 7px 0 !important;
    font-size: 12px !important;
  }

  .product-item-card div[style*="height: 135px"],
  .product-item-card div[style*="height:135px"] {
    height: 115px !important;
  }
  .product-item-card h3 {
    font-size: 13px !important;
  }

  .tool-card {
    padding: 10px !important;
  }
  .tool-card div[style*="width: 46px; height: 46px"] {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }
  .tool-card p[style*="font-size: 16px"],
  .tool-card p[style*="font-size: 15px"] {
    font-size: 13.5px !important;
  }
  .tool-card p[style*="font-size: 11px"] {
    font-size: 10px !important;
  }

  /* Subpage filter chips horizontal scrolling */
  div[style*="display: flex; gap: 8px; flex-wrap: wrap"],
  div[style*="display: flex; gap: 10px; flex-wrap: wrap"] {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch !important;
  }
  div[style*="display: flex; gap: 8px; flex-wrap: wrap"]::-webkit-scrollbar,
  div[style*="display: flex; gap: 10px; flex-wrap: wrap"]::-webkit-scrollbar {
    display: none !important;
  }
  div[style*="display: flex; gap: 8px; flex-wrap: wrap"] > button,
  div[style*="display: flex; gap: 8px; flex-wrap: wrap"] > a,
  div[style*="display: flex; gap: 10px; flex-wrap: wrap"] > button,
  div[style*="display: flex; gap: 10px; flex-wrap: wrap"] > a {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* 7. NATIVE MOBILE APP BOTTOM NAVIGATION BAR */
  .pm-mobile-app-bar {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-top: 1px solid #ede8df !important;
    box-shadow: 0 -3px 18px rgba(0, 0, 0, 0.08) !important;
    z-index: 9999 !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 4px !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
  }
  html.dark .pm-mobile-app-bar {
    background: rgba(26, 13, 16, 0.98) !important;
    border-top-color: #3a2428 !important;
    box-shadow: 0 -3px 18px rgba(0, 0, 0, 0.4) !important;
  }
  .app-tab-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    background: transparent !important;
    border: none !important;
    color: #7a6557 !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    padding: 4px 6px !important;
    cursor: pointer !important;
    flex: 1 !important;
    gap: 2px !important;
    font-family: inherit !important;
    transition: color 0.15s, transform 0.15s !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .app-tab-btn .tab-icon {
    font-size: 18px !important;
    line-height: 1 !important;
  }
  .app-tab-btn:active {
    transform: scale(0.92) !important;
  }
  .app-tab-btn.active,
  .app-tab-btn:hover {
    color: #7b191c !important;
    font-weight: 700 !important;
  }
  html.dark .app-tab-btn {
    color: #c8b4a8 !important;
  }
  html.dark .app-tab-btn.active,
  html.dark .app-tab-btn:hover {
    color: #ffd885 !important;
  }

  /* Leave bottom space so app bar doesn't cover footer links */
  body {
    padding-bottom: 64px !important;
  }
  #backToTop {
    bottom: 74px !important;
  }
}

/* ── Breakpoint: Small Mobile Screens (<= 480px) ── */
@media (max-width: 480px) {
  .hero-h1 {
    font-size: 28px !important;
  }
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  div[style*="border-radius: 14px; box-shadow: 0 4px 18px rgba(123,25,28,0.05)"] img {
    width: 44px !important;
    height: 44px !important;
  }
}


