/* ==========================================================================
   RESPONSIVE FINE-TUNING
   360 / 375 / 390 / 414 / 430 / 576 / 768 / 992 / 1200 / 1440 / 1920
   ========================================================================== */

/* --- Base mobile (≤575px): tighten type & spacing for narrow phones --- */
@media (max-width: 575px) {
  .display-1 { font-size: clamp(40px, 12vw, 56px); }
  .display-2 { font-size: clamp(36px, 10vw, 48px); }
  .display-3 { font-size: clamp(28px, 8vw, 38px); }
  .italy-title { font-size: clamp(44px, 15vw, 64px); }
}

/* --- 576px: small landscape phones / large phones --- */
@media (min-width: 576px) {
  .form-two { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   MOBILE-ONLY UX REFINEMENTS (≤767px)
   Scoped strictly to max-width:767px so nothing here touches tablet (768–991)
   or desktop (≥992) rendering. Companion to the mobile fixes in style.css
   (search for "MOBILE FIX" comments there for header/hero/rail/philosophy
   markup-adjacent rules kept alongside their base selectors).
   ========================================================================== */
@media (max-width: 767px) {
  /* 20px horizontal padding everywhere on mobile, 320–767px */
  :root { --page-margin: 20px; }

  /* Skip scroll-triggered fade-ins on mobile: content should never sit at
     opacity:0 waiting for an IntersectionObserver — on a phone that reads as
     a broken blank gap (and is exactly what full-page screenshot tools show,
     since they don't scroll to trigger the reveal). Desktop keeps the effect. */
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }

  /* Normalize section rhythm site-wide instead of per-section vh/clamp creep */
  .section { padding: 64px 0; }
  .section-tight { padding: 40px 0; }

  /* ---- 1. Header ---- */
  .site-header { height: 76px; }
  .logo-img--mark { width: 50px; height: auto; }
  .mobile-nav-foot a:last-child { display: none; } /* hide email, keep Business Enquiry */

  /* ---- 2. Hero CTA ---- */
  .hero-cta-row { justify-content: center; }
  .hero-cta-row .btn {
    flex: none;
    width: auto;
    min-width: 190px;
    height: 50px;
    min-height: 50px;
    padding: 0 26px;
    font-size: 13px;
    letter-spacing: 0.12em;
  }
  .hero-cta-row .text-link { display: none; } /* "Our Story" removed from mobile hero */

  /* ---- 3. Care Rooted in Nature ---- */
  .manifesto-heading { font-size: clamp(52px, 15vw, 64px); line-height: 0.95; }
  .manifesto-body { margin-top: 24px; }
  .manifesto-copy { font-size: 18px; line-height: 1.55; max-width: 100%; }
  .manifesto-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-top: 20px;
  }
  .manifesto-meta .num { font-size: clamp(30px, 9vw, 40px); }
  .manifesto-meta .lbl { font-size: 10px; line-height: 1.35; letter-spacing: 0.08em; overflow-wrap: break-word; }

  /* ---- 4. The Dr.Care Collection: horizontal touch-swipe carousel,
     one full product per slide, snap-locked, no peeking ---- */
  .product-rail {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    margin: 0 calc(var(--page-margin) * -1);
    padding: 32px 0 0;
    gap: 0;
    cursor: default;
  }
  .rail-card {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 20px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  .rail-card-name { font-size: clamp(28px, 8vw, 38px); line-height: 1.08; overflow-wrap: anywhere; }

  /* Pagination dots (desktop keeps the arrow + "01 / 07" counter instead) */
  .rail-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 22px 0 4px;
  }
  .rail-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--c-hairline);
    padding: 0;
    transition: background var(--dur-fast) var(--ease-editorial), width var(--dur-fast) var(--ease-editorial);
  }
  .rail-dot.is-active { background: var(--c-primary); width: 16px; border-radius: 3px; }

  /* ---- 6. Rosemary Mint Hair Care: tighten heading→image gap ---- */
  .stories-section .section-head { margin-bottom: 44px; }

  /* ---- 7. Brand Philosophy: minimal, compact, side-by-side number|content ---- */
  .philosophy-section { padding: 56px 0; }
  .philosophy-section .display-2 { font-size: clamp(40px, 11vw, 52px); line-height: 1; }
  .philosophy-section .phil-list { margin-top: 32px; }
  .phil-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 4px;
    padding: 22px 0;
    opacity: 1 !important; /* no scroll-threshold dimming on mobile — reveal immediately */
  }
  .phil-num { grid-column: 1; grid-row: 1 / span 2; font-size: 16px; margin-bottom: 0; }
  .phil-title { grid-column: 2; grid-row: 1; font-size: clamp(25px, 7vw, 30px); line-height: 1.1; margin-bottom: 10px; }
  .phil-copy { grid-column: 2; grid-row: 2; max-width: none; width: 100%; font-size: 16px; line-height: 1.5; }

  /* ---- 5. Get In Touch: fully removed on mobile, zero space, zero scroll trigger ---- */
  #contact { display: none !important; }

  /* ---- Why Dr.Care: keep it readable at fluid sizes without extra height ---- */
  .why-item { font-size: clamp(26px, 8vw, 34px); }

  /* ---- 10. Overflow safety net ---- */
  .manifesto-body, .lab-grid, .pd-layout, .skin-grid, .related-grid,
  .footer-nav-grid, .form-two { min-width: 0; }
  .display-1, .display-3, .story-name, .skin-name { overflow-wrap: anywhere; }
}

/* Extremely narrow phones: let the three stats go 2 + 1 instead of squeezing */
@media (max-width: 349px) {
  .manifesto-meta { grid-template-columns: repeat(2, 1fr); }
  .manifesto-meta > div:last-child { grid-column: 1 / -1; }
}

/* ==========================================================================
   FLOATING WHATSAPP ORDER BUTTON (homepage only — see index.html)
   ========================================================================== */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 590; /* above page content, but tucks beneath the open mobile-nav (600) */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: #FFFFFF;
  padding: 15px 24px 15px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(18, 61, 38, 0.28), 0 2px 6px rgba(0, 0, 0, 0.12);
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  transition: transform 240ms var(--ease-editorial), box-shadow 240ms var(--ease-editorial), background 240ms var(--ease-editorial);
  animation: whatsappPulse 1.3s ease-in-out 1.4s 2;
}
.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  background: #1FAF57;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(18, 61, 38, 0.34), 0 4px 10px rgba(0, 0, 0, 0.16);
}
.whatsapp-float:active { transform: translateY(-1px); }
.whatsapp-float-icon {
  font-size: 22px; /* Font Awesome brand icon is sized via font-size, not width/height */
  line-height: 1;
  color: #FFFFFF;
  flex-shrink: 0;
  display: inline-block;
}

@keyframes whatsappPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-float { animation: none; }
}

@media (max-width: 767px) {
  .whatsapp-float {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    min-height: 48px;
    padding: 12px 18px 12px 14px;
    font-size: 12px;
    gap: 10px;
  }
  .whatsapp-float-icon { font-size: 20px; }
}

/* --- 768px: tablets --- */
@media (min-width: 768px) {
  :root { --page-margin: 40px; }
  .hero-cta-row .btn { flex: 0 0 auto; }
  .split-panel { min-height: 520px; }
}

/* --- 992px: small laptops / nav breakpoint --- */
@media (min-width: 992px) {
  :root { --page-margin: 56px; }
}

/* --- 1200px --- */
@media (min-width: 1200px) {
  :root { --page-margin: 64px; }
  .manifesto-copy { max-width: 520px; }
}

/* --- 1440px: large desktop --- */
@media (min-width: 1440px) {
  :root { --page-margin: 80px; }
}

/* --- 1920px: extra-wide --- */
@media (min-width: 1920px) {
  .wrap { max-width: 1600px; }
}

/* --- Touch target safety net (brief requires 44x44 minimum) --- */
@media (pointer: coarse) {
  .icon-btn, .rail-arrow, .hamburger, .footer-accordion-btn { min-width: 44px; min-height: 44px; }
  .btn { min-height: 48px; }
}

/* --- Landscape phones: shrink hero height so content isn't squeezed --- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { height: 100vh; min-height: 360px; }
}

/* --- Prevent horizontal scroll safety net --- */
html, body { max-width: 100%; overflow-x: hidden; }
