/* ============================================================================
   Bengaluru Pets — design layer  "Jacaranda & Gulmohar"
   ----------------------------------------------------------------------------
   Loaded AFTER tailwind.css so it can override compiled utilities.

   Tailwind here is PRE-COMPILED (no build step on this box), so new arbitrary
   utility classes silently do nothing. Everything below is therefore either a
   plain CSS component class or an override of a utility that already exists in
   the compiled sheet.

   The palette is named for the two trees that colour Bengaluru every summer —
   jacaranda violet and gulmohar orange. --brand / --accent are injected from
   SiteSettings in base.html; the rest derive from them.
   ========================================================================= */

:root {
  --ink:            #1B1636;   /* deep aubergine — text, footer            */
  --ink-soft:       #4A4463;   /* secondary text                           */
  --jacaranda:      #4A37A8;   /* primary                                  */
  --jacaranda-deep: #2E2266;   /* gradient anchor                          */
  --jacaranda-lift: #6B54D3;   /* gradient highlight                       */
  --gulmohar:       #F0592B;   /* accent — CTAs                            */
  --marigold:       #FFB020;   /* secondary accent — prices, badges        */
  --mist:           #F6F4FB;   /* page background, faint violet tint       */
  --line:           #E7E3F3;   /* hairlines                                */
  --paper:          #FFFFFF;

  --radius:      14px;
  --radius-lg:   22px;
  --shadow-sm:   0 1px 2px rgba(27,22,54,.06), 0 2px 8px rgba(27,22,54,.05);
  --shadow-md:   0 4px 12px rgba(27,22,54,.08), 0 12px 32px rgba(27,22,54,.07);
  --shadow-lift: 0 10px 20px rgba(27,22,54,.10), 0 24px 56px rgba(74,55,168,.16);

  --display: 'Bricolage Grotesque', 'Plus Jakarta Sans', sans-serif;
}

/* ── Foundations ───────────────────────────────────────────────────────── */

body { background: var(--mist); color: var(--ink); }

/* Deliberately no `color` here: headings inherit, so a heading inside a dark
   container (hero band, table header) stays legible instead of being forced
   back to ink. body already sets --ink as the default. */
h1, h2, h3, .display {
  font-family: var(--display);
  letter-spacing: -0.022em;
}
h1 { font-weight: 800; }
h2, h3 { font-weight: 700; }

/* Prices and any tabular figure line up column-wise. */
.price, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

::selection { background: color-mix(in srgb, var(--jacaranda) 22%, #fff); color: var(--ink); }

:where(a, button, [role="button"]):focus-visible {
  outline: 3px solid var(--gulmohar);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
/* The old hero was one flat fill across the full width with the right half
   empty. Layered radial washes give it depth without needing artwork.        */

.hero-gradient,
.cat-hero-wrap {
  position: relative;
  background:
    radial-gradient(1100px 520px at 88% -10%, color-mix(in srgb, var(--jacaranda-lift) 78%, transparent) 0%, transparent 62%),
    radial-gradient(760px 420px at 8% 108%, color-mix(in srgb, var(--gulmohar) 34%, transparent) 0%, transparent 60%),
    linear-gradient(142deg, var(--jacaranda-deep) 0%, var(--jacaranda) 52%, #3A2B8C 100%);
  color: #fff;
  isolation: isolate;
}

/* A whisper of grain so the large flat areas do not band on wide screens. */
.hero-gradient::after,
.cat-hero-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

.hero-gradient h1, .cat-hero-wrap h1,
.hero-gradient h2, .cat-hero-wrap h2 { color: #fff; }

/* Readable body copy on the hero — the old green-on-green failed contrast. */
.hero-gradient p, .cat-hero-wrap p { color: rgba(255,255,255,.86); }
.cat-hero-wrap nav, .cat-hero-wrap nav a { color: rgba(255,255,255,.72); }
.cat-hero-wrap nav a:hover { color: #fff; }

/* Pills sitting on the hero. */
.hero-pill {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.24);
  color: #fff;
  backdrop-filter: blur(6px);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-weight: 700; font-size: .95rem; line-height: 1;
  padding: .85rem 1.5rem; border-radius: 999px;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--gulmohar) 0%, #FF7A47 100%);
  color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--gulmohar) 38%, transparent);
}
.btn-primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--gulmohar) 46%, transparent); }

.btn-ink {
  background: linear-gradient(135deg, var(--jacaranda) 0%, var(--jacaranda-lift) 100%);
  color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--jacaranda) 34%, transparent);
}

.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

.btn-quiet { background: var(--paper); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-quiet:hover { border-color: color-mix(in srgb, var(--jacaranda) 40%, #fff); }

/* ── Header & navigation ───────────────────────────────────────────────── */

header, .site-header {
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}

/* Underline that grows from the centre — replaces the plain colour swap. */
.nav-link {
  position: relative;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color .18s ease;
}
.nav-link::after {
  content: '';
  position: absolute; left: 50%; bottom: -6px;
  width: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--jacaranda), var(--gulmohar));
  transform: translateX(-50%);
  transition: width .22s cubic-bezier(.4,0,.2,1);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 100%; }

.dropdown-menu {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
  overflow: hidden;
  padding: .35rem !important;
}
.dropdown-menu a {
  border-radius: 9px;
  transition: background-color .15s ease, color .15s ease;
}
.dropdown-menu a:hover {
  background: color-mix(in srgb, var(--jacaranda) 9%, #fff);
  color: var(--jacaranda) !important;
}

/* ── Mobile menu ───────────────────────────────────────────────────────── */

#mobile-menu {
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  animation: menuDrop .22s cubic-bezier(.4,0,.2,1);
  background: var(--paper);
  /* The menu sits inside a `sticky top-0` nav, so scrolling the page never
     moves it — it needs its own bounded scroll or the lower half is
     unreachable. 56px ~= the nav bar it hangs beneath. */
  /* Fallback only — sizeMobileMenu() in base.html measures the real gap
     between the menu's top and the fixed tab bar and overrides this. */
  max-height: calc(100svh - 132px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
}
@keyframes menuDrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.mm { padding: .5rem .75rem 0; }

/* Section labels give the list a shape — browse, company, legal. */
.mm-label {
  font-size: .66rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase;
  color: #948DB0;
  padding: 1.1rem .5rem .35rem;
}
.mm-label:first-child { padding-top: .35rem; }

.mm-row {
  display: flex !important;
  align-items: center;
  gap: .8rem;
  width: 100%;
  min-height: 50px;
  padding: 0 .6rem;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink) !important;
  text-align: left;
  transition: background-color .15s ease, color .15s ease;
}
.mm-row:active { background: color-mix(in srgb, var(--jacaranda) 10%, #fff); }

/* Fixed-width icon column so every label starts on the same x. */
.mm-ico {
  width: 22px; flex: none; text-align: center;
  font-size: .95rem;
  color: var(--jacaranda);
  opacity: .75;
}

.mm-row.is-active {
  background: color-mix(in srgb, var(--jacaranda) 10%, #fff);
  color: var(--jacaranda) !important;
}
.mm-row.is-active .mm-ico { opacity: 1; }

.mm-toggle { justify-content: flex-start; }
.mm-chev {
  margin-left: auto;
  font-size: .7rem;
  color: #948DB0;
  transition: transform .2s ease;
}
.mobile-chevron-open { transform: rotate(180deg); }

.mm-sub {
  margin: .1rem 0 .4rem 1.55rem;
  padding-left: .75rem;
  border-left: 2px solid color-mix(in srgb, var(--jacaranda) 26%, #fff);
}
.mm-sub a {
  display: flex; align-items: center; gap: .55rem;
  min-height: 42px;
  padding: 0 .5rem;
  border-radius: 9px;
  font-size: .9rem; font-weight: 500;
  color: var(--ink-soft) !important;
}
.mm-sub a:active { background: var(--mist); }
.mm-emoji { width: 20px; text-align: center; font-size: 1rem; }

.mm-cta { display: flex; gap: .6rem; padding: 1.1rem .5rem .25rem; }
.mm-cta-btn { flex: 1; padding: .8rem 1rem; font-size: .9rem; }
.mm-addr {
  padding: .55rem .5rem 0;
  font-size: .72rem; line-height: 1.5;
  color: #948DB0;
}

#mobile-menu-btn {
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: 12px;
  transition: background-color .15s ease;
}
#mobile-menu-btn:active { background: var(--mist); }

body.menu-open #wa-fab-wrap { opacity: 0; pointer-events: none; }
#wa-fab-wrap { transition: opacity .18s ease; }

/* ── Cards ─────────────────────────────────────────────────────────────── */

.pet-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .26s cubic-bezier(.4,0,.2,1), box-shadow .26s ease, border-color .26s ease;
}
.pet-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--jacaranda) 26%, #fff);
}
.pet-card img { transition: transform .5s cubic-bezier(.4,0,.2,1); }
.pet-card:hover img { transform: scale(1.055); }

/* Badges that sit on card imagery. */
.card-badge {
  background: rgba(27,22,54,.72);
  color: #fff;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  font-size: .625rem; padding: .3rem .6rem; border-radius: 999px;
}
.card-badge-new  { background: linear-gradient(135deg, var(--jacaranda), var(--jacaranda-lift)); }
.card-badge-sale { background: linear-gradient(135deg, var(--gulmohar), #FF8A5B); }

/* ── Signature: the 25% advance chip ───────────────────────────────────── */
/* Booking on 25% advance is the thing that actually separates this shop from
   a classifieds listing, so it gets the one loud element on the card: a chip
   whose ring is filled to exactly the fraction being paid now.               */

.advance-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .3rem .7rem .3rem .3rem;
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--marigold) 20%, #fff), color-mix(in srgb, var(--gulmohar) 12%, #fff));
  border: 1px solid color-mix(in srgb, var(--gulmohar) 34%, #fff);
  color: #8A3410;
  font-weight: 800; font-size: .72rem; line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.advance-chip::before {
  content: '';
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  /* 25% of the ring filled, the rest track. */
  background: conic-gradient(var(--gulmohar) 0turn .25turn, color-mix(in srgb, var(--gulmohar) 22%, #fff) .25turn 1turn);
  box-shadow: inset 0 0 0 3.5px #fff;
}

.price {
  font-family: var(--display);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.price-strike { color: #9A93B4; text-decoration: line-through; font-weight: 600; }

/* ── Section headings ──────────────────────────────────────────────────── */

.eyebrow {
  font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--jacaranda);
}

/* ── Rich text ─────────────────────────────────────────────────────────── */
/* Tailwind's typography plugin is NOT in the compiled sheet, so `prose` is a
   no-op and long-form content rendered as flat undifferentiated text.        */

.rich-text { color: var(--ink-soft); line-height: 1.75; }
.rich-text > * + * { margin-top: 1rem; }
.rich-text h2 { font-size: 1.5rem; margin-top: 2.25rem; }
.rich-text h3 { font-size: 1.175rem; margin-top: 1.75rem; }
.rich-text h2:first-child, .rich-text h3:first-child { margin-top: 0; }
.rich-text p { margin-bottom: 0; }
.rich-text strong { color: var(--ink); font-weight: 700; }
.rich-text a { color: var(--jacaranda); text-decoration: underline; text-underline-offset: 2px; }
.rich-text ul, .rich-text ol { padding-left: 1.35rem; }
.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text li { margin-top: .4rem; }
.rich-text li::marker { color: var(--gulmohar); }
.rich-text table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rich-text th, .rich-text td { border: 1px solid var(--line); padding: .55rem .75rem; text-align: left; }
.rich-text th { background: var(--mist); font-weight: 700; color: var(--ink); }

/* ── Locality chips (shop pages) ───────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center;
  padding: .45rem 1rem; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: .85rem; font-weight: 600;
  transition: border-color .16s ease, color .16s ease, transform .16s ease;
}
.chip:hover {
  border-color: color-mix(in srgb, var(--jacaranda) 45%, #fff);
  color: var(--jacaranda);
  transform: translateY(-1px);
}

/* ── Footer ────────────────────────────────────────────────────────────── */

footer {
  background: linear-gradient(170deg, var(--ink) 0%, #120E24 100%) !important;
  color: rgba(255,255,255,.66);
}
footer h2, footer h3, footer h4, footer .footer-head { color: #fff; }
footer a { color: rgba(255,255,255,.66); transition: color .15s ease; }
footer a:hover { color: #fff; }

/* ── Utility overrides that already exist in the compiled sheet ────────── */

.rounded-xl  { border-radius: var(--radius) !important; }
.rounded-2xl { border-radius: var(--radius-lg) !important; }

/* ── Hero: two-column with the shop card ───────────────────────────────── */

.hero-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0,1.15fr) minmax(340px,.85fr); gap: 4rem; }
}

.hero-card {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 20px 60px rgba(15,10,40,.28);
}
.hero-card-eyebrow {
  font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--marigold); margin-bottom: .5rem;
}
.hero-card-title {
  font-family: var(--display); font-weight: 800; font-size: 1.4rem;
  color: #fff !important; letter-spacing: -.02em; margin-bottom: .35rem;
}
.hero-card-addr { font-size: .875rem; line-height: 1.55; color: rgba(255,255,255,.74) !important; }
.hero-card-rule { height: 1px; background: rgba(255,255,255,.18); margin: 1.15rem 0; }

.hero-card-list { display: grid; gap: .7rem; font-size: .9rem; color: rgba(255,255,255,.88); }
.hero-card-list li { display: flex; align-items: flex-start; gap: .65rem; line-height: 1.45; }
.hero-card-list strong { color: #fff; font-weight: 700; }

.hero-dot {
  width: 14px; height: 14px; border-radius: 50%; flex: none; margin-top: .18rem;
  background: rgba(255,255,255,.22);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.10);
}
/* Same 25%-filled ring as the card chips, so the mechanic reads the same everywhere. */
.hero-dot-25 {
  background: conic-gradient(var(--marigold) 0turn .25turn, rgba(255,255,255,.22) .25turn 1turn);
  box-shadow: inset 0 0 0 3.5px var(--jacaranda-deep);
}

/* ── Page loader: a walking paw trail ──────────────────────────────────── */
/* A generic spinner says nothing about the shop. Five prints step across in
   sequence, alternating above and below the line the way a real gait does,
   and the last one lands in gulmohar so the trail resolves on the accent.   */

#page-loader {
  background: color-mix(in srgb, var(--mist) 88%, transparent);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.paw-trail {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
}

.paw-step {
  width: 30px; height: 30px; flex: none;
  fill: var(--jacaranda);
  opacity: 0;
  animation: pawWalk 1.55s cubic-bezier(.4,0,.2,1) infinite;
}
/* Alternate the vertical offset and tilt so it reads as a gait, not a row. */
.paw-step:nth-child(odd)  { transform: translateY(-9px) rotate(-16deg); }
.paw-step:nth-child(even) { transform: translateY(9px)  rotate(16deg); }

.paw-step:nth-child(1) { animation-delay: 0s; }
.paw-step:nth-child(2) { animation-delay: .13s; }
.paw-step:nth-child(3) { animation-delay: .26s; }
.paw-step:nth-child(4) { animation-delay: .39s; }
.paw-step:nth-child(5) { animation-delay: .52s; fill: var(--gulmohar); }

@keyframes pawWalk {
  0%       { opacity: 0; }
  14%      { opacity: 1; }
  55%      { opacity: 1; }
  100%     { opacity: 0; }
}

.paw-caption {
  font-family: var(--display);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* Static, legible fallback when motion is unwelcome. */
@media (prefers-reduced-motion: reduce) {
  .paw-step { opacity: 1; animation: none; }
}
