/* ==========================================================================
   YSN INTERIORS - MOBILE FIRST RESPONSIVE STYLESHEET
   Covers: Utility Bar, Pill Navbar, Hero, Stats Bar, Categories, Promise,
           Services, Footer, Gallery, Traders, Projects, Contact, and more.
   Breakpoints: Mobile-first (≤ 480px), Phablet (≤ 600px), Tablet (≤ 900px), Desktop (≥ 1024px)
   ========================================================================== */

/* ============================================================
   0. BASE TOUCH IMPROVEMENTS
   ============================================================ */
* {
  -webkit-tap-highlight-color: transparent;
}

a, button {
  touch-action: manipulation;
}

/* ============================================================
   1. UTILITY BAR — Hide on small screens, keep minimal on tablet
   ============================================================ */
/* Fix iOS turning phone numbers blue */
a[href^="tel:"] {
  color: inherit !important;
  text-decoration: none !important;
}

@media (max-width: 767px) {
  .utility-bar { 
    display: flex !important; 
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .utility-bar > div:first-child {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 12px !important;
    font-size: 12px !important;
  }
  .utility-links { 
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
  }
  .utility-links > div { 
    margin: 0 !important; 
    padding: 6px 12px !important; 
    font-size: 11px !important; 
    white-space: normal !important;
    text-align: center !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .utility-bar {
    padding: 8px 24px !important;
    font-size: 11px !important;
  }
}

/* ============================================================
   2. PILL NAVBAR — Mobile hamburger-friendly layout
   ============================================================ */
@media (max-width: 900px) {
  .site-header-wrapper {
    display: flex !important;
    visibility: visible !important;
  }
  .pill-navbar {
    position: relative !important;
    margin-top: 10px !important;
    width: calc(100% - 24px) !important;
    padding: 6px 12px !important;
    border-radius: 40px !important;
    align-self: center !important;
    left: auto !important;
    transform: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* Hide desktop nav links */
  .pill-nav-links, .pill-nav-links * {
    display: none !important;
  }

  /* Hide enquire button — replaced by hamburger */
  .pill-navbar > a.btn-enquire-new {
    display: none !important;
  }

  /* Show mobile hamburger toggle */
  .pill-navbar .custom-menu-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--color-primary-dark, #0d421d) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 20px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  .pill-navbar img {
    height: 52px !important;
  }
}

/* ============================================================
   3. MOBILE MENU TOGGLE (Hamburger button in pill navbar)
   ============================================================ */
.pill-navbar .custom-menu-toggle {
  display: none; /* Hidden by default — shown via media query above */
}

/* Mobile Dropdown Menu */
@media (max-width: 900px) {
  body.menu-open .pill-nav-links,
  body.menu-open .pill-nav-links * {
    display: flex !important;
  }
  body.menu-open .pill-nav-links {
    position: absolute;
    top: 70px;
    left: 12px;
    width: calc(100% - 24px);
    background: white;
    flex-direction: column;
    padding: 24px 20px;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    gap: 16px;
  }
  body.menu-open .pill-nav-links a {
    color: var(--color-primary-dark, #0d421d);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }
  body.menu-open .pill-nav-links a:last-child {
    border-bottom: none;
  }
  /* Enquire button in dropdown */
  body.menu-open .pill-navbar > a.btn-enquire-new {
    display: flex !important;
    position: absolute;
    top: calc(70px + 100% + 16px);
    left: 12px;
    width: calc(100% - 24px);
    justify-content: center;
  }
}

/* ============================================================
   4. HERO SECTION — Full mobile rework
   ============================================================ */
@media (max-width: 900px) {
  .hero-new {
    padding: 120px 16px 32px !important; /* Add top padding to clear pill navbar */
    align-items: center !important; /* Center properly */
    justify-content: center !important;
    min-height: 100svh;
    overflow: hidden;
  }

  .hero-content {
    max-width: 100% !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-subtitle {
    font-size: 10px !important;
    letter-spacing: 0.15em !important;
    margin-bottom: 10px !important;
    text-align: center;
  }

  .hero-title-box {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 14px 18px !important;
    border-radius: 12px !important;
    width: 100% !important;
    max-width: 340px !important;
  }

  /* Hide the large logo inside the hero card on mobile 
     (the navbar already shows the logo) */
  .hero-title-box img {
    display: none !important;
  }

  .hero-title {
    font-size: clamp(2.5rem, 12vw, 3.5rem) !important; /* Huge fonts */
    line-height: 1.05 !important;
  }

  .hero-desc {
    font-size: 13px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
    max-width: 320px;
  }

  .hero-content > div[style*="display: flex; gap: 20px"],
  .hero-content > div[style*="gap: 20px"] {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .hero-content .btn-enquire-new {
    width: 100% !important;
    justify-content: center !important;
    padding: 14px 20px !important;
    font-size: 14px !important;
  }
}

/* ============================================================
   5. STATS BAR — Move below hero on mobile, prevent overflow
   ============================================================ */
@media (max-width: 900px) {
  .stats-bar {
    position: relative !important;
    transform: none !important;
    left: auto !important;
    bottom: auto !important;
    width: 90% !important;
    max-width: 400px !important;
    margin: 20px auto !important;
    border-radius: 12px !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    padding: 16px 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
  }

  .stat-item {
    flex: 1 1 48% !important;
    padding: 10px 6px !important;
    gap: 8px !important;
    justify-content: flex-start;
  }

  .stat-item i {
    font-size: 22px !important;
  }

  .stat-text strong {
    font-size: 13px !important;
    margin-bottom: 2px !important;
  }

  .stat-text span {
    font-size: 10px !important;
  }

  .stat-divider {
    display: none !important;
  }

  /* Remove the large bottom margin from hero that was
     reserved for the absolutely-positioned stats bar */
  .hero-new {
    margin-bottom: 0 !important;
  }
}

/* ---- STATS BAR — HIDE on mobile (prevents empty gap below hero) ---- */
@media (max-width: 900px) {
  .stats-bar {
    display: none !important;
  }
}

/* ---- CATEGORIES SECTION — Remove the 160px top padding reserved for stats bar ---- */
@media (max-width: 900px) {
  .categories-section {
    padding-top: 40px !important;
  }
}

/* ============================================================
   6. CATEGORIES SECTION — Stack on mobile
   ============================================================ */
@media (max-width: 900px) {
  .categories-section {
    flex-direction: column !important;
    padding: 60px 5% 60px !important;
    gap: 40px !important;
  }

  .cat-text {
    flex: none !important;
    width: 100% !important;
  }

  .cat-text h2 {
    font-size: clamp(1.8rem, 6vw, 2.5rem) !important;
  }

  .cat-cards {
    width: 100% !important;
    padding-bottom: 16px !important;
  }

  .cat-card {
    min-width: 180px !important;
  }
}

/* ============================================================
   7. PROMISE / FEATURE SECTION — Stack on mobile
   ============================================================ */
@media (max-width: 900px) {
  .promise-section {
    flex-direction: column !important;
    padding: 40px 5% !important;
    gap: 32px !important;
  }

  .promise-badge {
    font-size: 22px !important;
    padding: 12px 28px !important;
    width: 100% !important;
    text-align: center !important;
  }

  .promise-stats {
    flex-direction: column !important;
    gap: 16px !important;
    width: 100% !important;
  }

  .promise-features {
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 12px !important;
  }

  .promise-feature-box {
    width: calc(50% - 6px) !important;
    padding: 16px 8px !important;
  }
}

/* ============================================================
   8. FOOTER — Mobile-first full rework
   ============================================================ */
@media (max-width: 900px) {
  .boxed-footer {
    padding: 60px 5% !important;
    margin-top: 60px !important;
  }

  .footer-top {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    margin-bottom: 60px !important;
  }

  .footer-image {
    height: 200px !important;
  }

  .footer-cta h2 {
    font-size: clamp(28px, 7vw, 40px) !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    gap: 40px !important;
  }
}

/* ============================================================
   9. RESPONSIVE GRID UTILITY
   ============================================================ */
@media (max-width: 600px) {
  .responsive-grid-3 {
    grid-template-columns: 1fr !important;
  }

  .brand-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .responsive-grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .brand-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ============================================================
   10. GALLERY PAGE — Stack masonry on mobile
   ============================================================ */
@media (max-width: 600px) {
  .gallery-grid,
  [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

/* ============================================================
   11. CONTACT PAGE
   ============================================================ */
@media (max-width: 767px) {
  .contact-split {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   12. BOOKING / FORM PAGES
   ============================================================ */
@media (max-width: 600px) {
  .booking-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   13. TRADERS PAGE — Hero & Brand Cards
   ============================================================ */
@media (max-width: 767px) {
  .trader-hero {
    height: 50vh !important;
    min-height: 320px !important;
  }

  .trader-content h1 {
    font-size: clamp(1.8rem, 7vw, 2.5rem) !important;
  }
}

/* ============================================================
   14. PROJECTS PAGE — Cards & Filters
   ============================================================ */
@media (max-width: 767px) {
  .ysn-overview-card {
    width: 100% !important;
  }

  #view-overview > div {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

/* ============================================================
   15. SECTION PADDING — Comfortable on mobile
   ============================================================ */
@media (max-width: 767px) {
  .section,
  .section-padding,
  [class*="section"] {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* ============================================================
   16. TYPOGRAPHY — Fluid & readable on small screens
   ============================================================ */
@media (max-width: 480px) {
  h1 { font-size: clamp(1.9rem, 8vw, 2.5rem) !important; }
  h2 { font-size: clamp(1.6rem, 6.5vw, 2.2rem) !important; }
  h3 { font-size: clamp(1.3rem, 5vw, 1.8rem) !important; }

  p, li {
    font-size: 15px !important;
    line-height: 1.7 !important;
  }
}

/* ============================================================
   17. NILS FOOTER GRID — Already had partial coverage; enforce
   ============================================================ */
@media (max-width: 600px) {
  .nils-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

/* ============================================================
   18. ABOUT PAGE — Two-col layouts
   ============================================================ */
@media (max-width: 767px) {
  [style*="display: flex; gap: 80px"],
  [style*="display: flex; gap: 60px"] {
    flex-direction: column !important;
    gap: 32px !important;
  }

  [style*="display: grid; grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

/* ============================================================
   19. FLOATING WHATSAPP / CTA BUTTON (Mobile exclusive)
   ============================================================ */
.mobile-cta-fab {
  display: none;
}

@media (max-width: 900px) {
  .mobile-cta-fab {
    display: flex;
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 9999;
    align-items: center;
    gap: 10px;
    background: #25D366;
    color: white;
    padding: 14px 20px;
    border-radius: 50px;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    font-family: var(--font-body), sans-serif;
    font-weight: 600;
    font-size: 14px;
    animation: fab-bounce 3s ease-in-out infinite;
  }

  .mobile-cta-fab i {
    font-size: 22px;
  }

  @keyframes fab-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
  }
}

/* ============================================================
   20. OVERFLOW & SCROLL SAFETY
   ============================================================ */
@media (max-width: 900px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
}

/* ============================================================
   21. IMAGE ASPECT RATIOS — Don't let images bust layout
   ============================================================ */
@media (max-width: 600px) {
  .cat-img {
    height: 200px !important;
  }

  .nils-showcase-card img,
  .nils-card-img {
    height: 200px !important;
  }
}

/* ============================================================
   22. MATERIAL SWATCHES — Horizontal Scrolling on Mobile
   ============================================================ */
@media (max-width: 767px) {
  .color-content > div {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 20px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    margin-left: -20px !important; /* Pull out of standard padding to hit screen edge */
    margin-right: -20px !important;
    scroll-snap-type: x mandatory !important;
    gap: 16px !important;
    /* Hide scrollbar */
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
  }
  .color-content > div::-webkit-scrollbar {
    display: none !important;
  }
  .swatch-card {
    flex: 0 0 auto !important;
    width: 240px !important; /* Fixed width on mobile so they peek out */
    scroll-snap-align: start !important;
  }
}
