/* ═══════════════════════════════════════════════════════════════
   Ceylon Elegance — Responsive Stylesheet
   Fixes all mobile/tablet layout issues across all pages.
   Mobile-first approach, desktop enhancements via min-width queries.
═══════════════════════════════════════════════════════════════ */

/* ── 1. Global resets & base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden !important;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  padding-bottom: 0 !important;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 2. Announcement bar ─────────────────────────────────────── */
/* Hide on small phones to save space */
@media (max-width: 480px) {
  #announcement-bar {
    display: none !important;
  }
}

/* ── 3. Navigation ───────────────────────────────────────────── */
#main-nav-content {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

@media (min-width: 768px) {
  #main-nav-content {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }
  body {
    padding-bottom: 0 !important;
  }
}

/* Mobile drawer */
#mobile-menu-drawer {
  width: min(85vw, 360px) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(196, 199, 199, 0.3);
}

#mobile-menu-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-nav-link {
  font-family: 'Playfair Display', serif !important;
  font-size: 24px !important;
  text-transform: capitalize !important;
  letter-spacing: 0.01em !important;
  border-bottom: 1px solid rgba(196, 199, 199, 0.2);
  padding-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mobile-nav-link::after {
  content: '→';
  font-size: 18px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  color: #c9a84c;
}

.mobile-nav-link:hover {
  color: #c9a84c !important;
  padding-left: 8px;
}

.mobile-nav-link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* ── 4. Hero section (index.html) ────────────────────────────── */
#hero {
  min-height: 100svh;      /* use small viewport height on mobile */
  height: auto !important;
}

@media (max-width: 767px) {
  #hero {
    min-height: 600px;
    padding-top: 80px;     /* clear the fixed nav */
    padding-bottom: 24px;
  }

  /* Prevent parallax jumping on mobile */
  #hero #hero-img,
  #hero-img {
    transform: none !important;
  }

  /* Scale display headline */
  #hero h1,
  #hero .font-display-lg {
    font-size: clamp(32px, 8vw, 46px) !important;
    line-height: 1.1 !important;
  }

  /* Stack CTA buttons vertically */
  #hero .flex.flex-wrap {
    flex-direction: column !important;
    gap: 12px !important;
  }
  #hero .flex.flex-wrap > a {
    width: 100% !important;
    text-align: center;
    justify-content: center;
    display: flex !important;
  }

  /* Move hero stats inline below copy (not absolute) */
  #hero .hero-stats {
    position: static !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px 32px !important;
    margin-top: 28px !important;
    padding: 0 !important;
  }

  /* Hide scroll indicator to reduce clutter */
  #hero .bottom-28 {
    display: none !important;
  }
}

@media (max-width: 420px) {
  #hero h1,
  #hero .font-display-lg {
    font-size: 30px !important;
  }
  #hero {
    min-height: 520px;
  }
}

/* ── 5. Page hero banners (collections, about, contact) ──────── */
/* Pages that use pt-[140px] or a tall h-[600px]/h-[700px] banner */
section.relative.h-screen,
section[class*="min-h-[700px]"],
section[class*="h-[600px]"],
section[class*="h-[700px]"] {
  height: auto !important;
}

@media (max-width: 767px) {
  /* Page hero / banner areas */
  section[class*="pt-[140px]"] {
    padding-top: 110px !important;
    padding-bottom: 48px !important;
  }

  section.relative[class*="h-[600px]"],
  section.relative[class*="h-[700px]"] {
    min-height: 380px !important;
    height: auto !important;
    padding-top: 100px !important;
    padding-bottom: 40px !important;
  }

  /* Inner display headings on banners */
  section.relative h1 {
    font-size: clamp(30px, 8vw, 44px) !important;
    line-height: 1.1 !important;
  }
}

/* ── 6. Bento / collection grid (index.html) ─────────────────── */
.grid[class*="md:h-[800px]"],
.grid[class*="min-h-[600px]"] {
  height: auto !important;
  min-height: auto !important;
}

/* Fixed-height collection cards — let them flow naturally on mobile */
@media (max-width: 767px) {
  /* Large hero card */
  div[class*="md:col-span-2"][class*="h-[400px]"] {
    height: 280px !important;
  }

  /* Right-stack cards */
  div[class*="h-[250px]"] {
    height: 220px !important;
  }

  /* Tall product feature cards */
  [class*="h-[500px]"],
  [class*="h-[400px]"],
  [class*="h-[320px]"] {
    height: auto !important;
    min-height: auto !important;
  }
}

@media (min-width: 768px) {
  /* Restore proper bento height on tablet+ */
  div[class*="md:col-span-2"] {
    height: 100% !important;
  }
}

/* ── 7. Product grid (collections.html) ─────────────────────── */
@media (max-width: 480px) {
  #product-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }
}

/* Product card images — consistent height */
.product-card .aspect-\[3\/4\] {
  aspect-ratio: 3 / 4;
}

@media (max-width: 480px) {
  .product-card .aspect-\[3\/4\] {
    aspect-ratio: 4 / 5;
  }
}

/* Filter buttons — allow horizontal scroll on tiny screens */
@media (max-width: 480px) {
  .flex.flex-wrap.gap-2 > .filter-btn,
  .flex.gap-2 > .filter-btn {
    flex-shrink: 0;
  }
}

/* ── 8. Parallax / tall feature banner (index mid-page) ─────── */
@media (max-width: 767px) {
  section[class*="h-[500px]"].relative.overflow-hidden {
    height: 320px !important;
  }
}

/* ── 9. Map / iframe (contacts.html) ────────────────────────── */
@media (max-width: 767px) {
  /* Map iframe */
  div[class*="h-[500px]"] iframe,
  .h-\[500px\] {
    height: 280px !important;
  }
}

/* ── 10. Contact form ────────────────────────────────────────── */
@media (max-width: 767px) {
  #contactForm .grid.grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
}

/* ── 11. Footer newsletter form ─────────────────────────────── */
.newsletter-form {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.newsletter-form input {
  flex: 1;
  min-width: 200px;
}

.newsletter-form button {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .newsletter-form {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .newsletter-form input,
  .newsletter-form button {
    width: 100% !important;
  }
}

/* ── 12. Footer links / bottom bar ──────────────────────────── */
@media (max-width: 600px) {
  footer .flex.flex-wrap {
    gap: 12px 20px !important;
  }
}

/* ── 13. Testimonial section ─────────────────────────────────── */
#testimonial-track {
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
}
.testimonial-card {
  flex: 0 0 100%;
}

@media (max-width: 767px) {
  .testimonial-card {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ── 14. WhatsApp FAB ────────────────────────────────────────── */
#whatsapp-fab {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
  bottom: 24px !important;
  right: 14px !important;
}

@media (min-width: 768px) {
  #whatsapp-fab {
    bottom: 40px !important;
    right: 40px !important;
  }
  #whatsapp-fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5);
  }
}

/* Hide the expand text on mobile to keep FAB compact */
@media (max-width: 767px) {
  #whatsapp-fab span.max-w-0,
  #whatsapp-fab span:not(:first-child) {
    display: none !important;
  }
  #whatsapp-fab {
    padding: 12px !important;
  }
}

/* ── 15. Reveal animations ──────────────────────────────────── */
.reveal, .reveal-up, .reveal-left, .reveal-right {
  opacity: 0;
  transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal         { transform: translateY(24px); }
.reveal-up      { transform: translateY(32px); }
.reveal-left    { transform: translateX(-32px); }
.reveal-right   { transform: translateX(32px); }

.reveal.is-visible,
.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
  opacity: 1;
  transform: translate(0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-up, .reveal-left, .reveal-right {
    transition: opacity 0.4s ease !important;
    transform: none !important;
  }
  #hero-img {
    transform: none !important;
  }
  .ticker-inner {
    animation: none !important;
  }
}

/* ── 16. Announcement ticker ───────────────────────────────── */
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-inner {
  animation: ticker 28s linear infinite;
  display: flex;
  width: max-content;
}
.ticker-inner:hover { animation-play-state: paused; }

/* ── 17. Stats counter animation ─────────────────────────────── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stat-num { animation: countUp 0.7s ease forwards; }

/* ── 18. Scroll-line animation (hero indicator) ──────────────── */
@keyframes scroll-line {
  0%   { top: -6px; opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ── 19. Timeline (about page) ───────────────────────────────── */
@media (max-width: 767px) {
  /* Stack timeline items into a single-column vertical list */
  .grid.grid-cols-1.md\:grid-cols-2 > * + * {
    margin-top: 0;
  }
}

/* ── 20. Boutique / spaces grid (about page) ─────────────────── */
@media (max-width: 767px) {
  /* Ensure space images don't have crazy fixed heights */
  [class*="h-[320px]"] {
    height: 220px !important;
  }
}

/* ── 21. Section padding normalization ──────────────────────── */
/* py-xl is mapped to 80px in tailwind config — reduce on mobile */
@media (max-width: 767px) {
  .py-xl {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }
}

/* ── 22. General min-height override (prevents phantom space) ── */
@media (max-width: 767px) {
  [class*="min-h-["] {
    min-height: auto !important;
  }
}

/* ── 23. No-scrollbar utility ────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── 24. Media embed safety ─────────────────────────────────── */
.embed-responsive { max-width: 100%; height: auto; }


/* ── 26. Input / form fields (contacts.html) ─────────────────── */
.input-field {
  /* Prevent iOS zoom on focus (font-size must be ≥ 16px) */
  font-size: 16px !important;
}

/* ── 27. Artisan partner cards (about page) ─────────────────── */
@media (max-width: 767px) {
  .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 380px) {
  .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }
}

/* ── 28. Image quality helpers ───────────────────────────────── */
img {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ── 29. Product card consistency ────────────────────────────── */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card .aspect-\[3\/4\] {
  flex-shrink: 0;
}

/* ── 30. Hero stats better alignment ─────────────────────────── */
@media (max-width: 767px) {
  .hero-stats {
    column-gap: 32px !important;
    row-gap: 24px !important;
  }
}

@media (min-width: 768px) {
  .hero-stats {
    gap: 40px !important;
  }
}

/* ── 31. Featured collections grid gap consistency ──────────── */
#collections .grid {
  gap: 24px !important;
}

@media (max-width: 767px) {
  #collections .grid {
    gap: 16px !important;
  }
}

/* ── 32. Product strip grid alignment ───────────────────────── */
#product-strip {
  gap: 24px !important;
}

@media (max-width: 767px) {
  #product-strip {
    gap: 16px !important;
  }
}

/* ── 33. Why choose us grid spacing ─────────────────────────── */
.grid.lg\:grid-cols-4 {
  gap: 24px !important;
}

@media (max-width: 767px) {
  .grid.md\:grid-cols-2.lg\:grid-cols-4 {
    gap: 16px !important;
  }
}

/* ── 34. Section titles alignment ────────────────────────────– */
.section-eyebrow {
  margin-bottom: 16px !important;
}

/* ── 35. Testimonial card improved spacing ──────────────────── */
.testimonial-card {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.testimonial-card > div {
  height: 100%;
}

@media (min-width: 768px) {
  .testimonial-card {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* ── 36. Instagram gallery grid gap ─────────────────────────── */
.grid.grid-cols-2.md\:grid-cols-4 {
  gap: 12px !important;
}

@media (max-width: 480px) {
  .grid.grid-cols-2.md\:grid-cols-4 {
    gap: 8px !important;
  }
}

/* ── 37. Store location section grid ────────────────────────── */
.grid.gap-xl {
  gap: 80px !important;
}

@media (max-width: 767px) {
  .grid.gap-xl {
    gap: 48px !important;
  }
}

/* ── 38. Contact info items alignment ────────────────────────– */
.space-y-6 {
  gap: 24px !important;
}

.flex.gap-5.items-start {
  gap: 20px !important;
  align-items: flex-start;
}

/* ── 39. Button group alignment ─────────────────────────────── */
.flex.flex-wrap.gap-4 {
  gap: 16px !important;
}

@media (max-width: 480px) {
  .flex.flex-wrap.gap-4 {
    flex-direction: column !important;
  }
  .flex.flex-wrap.gap-4 > a,
  .flex.flex-wrap.gap-4 > button {
    width: 100% !important;
    text-align: center !important;
  }
}

/* ── 40. CTA buttons in hero section ────────────────────────── */
#hero .flex.flex-wrap {
  align-items: center;
}

#hero .hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── 41. Footer top strip layout ────────────────────────────– */
footer .grid.grid-cols-1 {
  gap: 32px !important;
}

@media (min-width: 768px) {
  footer .grid.grid-cols-1 {
    gap: 48px !important;
  }
}

/* ── 42. Better section spacing ─────────────────────────────– */
section.py-xl {
  padding-top: 80px !important;
  padding-bottom: 80px !important;
}

@media (max-width: 767px) {
  section.py-xl {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }
}