/* ==========================================================================
   MARS BATHWARE — RESPONSIVE DESIGN SYSTEM (v4.0)
   ========================================================================== */

/* Laptops & Desktops (< 1200px) */
@media (max-width: 1199.98px) {
  .nav-menu-desktop {
    gap: 18px;
  }

  .nav-link-item {
    font-size: 0.74rem;
  }

  .hero-monumental-stage {
    max-width: 600px;
  }

  .featured-gallery-wrapper {
    flex-direction: column-reverse;
  }

  .featured-thumb-strip {
    flex-direction: row;
    justify-content: center;
  }
}

/* Tablets (< 992px) */
@media (max-width: 991.98px) {
  :root {
    --header-height: 72px;
    --header-height-scrolled: 64px;
    --section-pad-y: clamp(60px, 8vw, 90px);
  }

  .nav-menu-desktop {
    display: none;
  }

  .btn-mobile-toggle {
    display: block;
  }

  .header-actions .btn-mars {
    display: none;
  }

  .hero-monumental-section {
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: 50px;
  }

  .hero-top-telemetry-bar {
    justify-content: center;
  }

  .hero-feature-chip.chip-left {
    left: 0;
    top: 20%;
  }

  .hero-feature-chip.chip-right {
    right: 0;
    bottom: 20%;
  }

  .hero-monumental-ceramic {
    max-width: 280px;
  }

  .hero-monumental-footer-bar {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .hero-footer-telemetry-strip {
    width: 100%;
    justify-content: space-between;
  }

  .hero-footer-cta-group {
    width: 100%;
    justify-content: center;
  }

  .orbital-stage-container {
    flex-direction: column;
    gap: 30px;
    min-height: auto;
  }

  .orbital-ring-outer {
    display: none;
  }

  .orbital-nodes-left,
  .orbital-nodes-right {
    width: 100%;
    align-items: center;
  }

  .orbital-nodes-right .orbital-node-item {
    flex-direction: row;
    text-align: left;
  }
}

/* Mobile Devices (< 576px) */
@media (max-width: 575.98px) {
  .header-container {
    padding: 0 20px;
  }

  .brand-logo-img {
    height: 30px;
  }

  .hero-category-selector-strip {
    flex-direction: column;
    width: 100%;
    border-radius: 16px;
  }

  .hero-cat-btn {
    width: 100%;
    justify-content: center;
  }

  .hero-stage-meta-bar {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    border-radius: 12px;
  }

  .meta-divider {
    display: none;
  }

  .hero-footer-telemetry-strip {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }

  .t-divider {
    display: none;
  }

  .hero-feature-chip {
    position: static;
    margin: 6px auto;
  }

  .featured-thumb-btn {
    width: 60px;
    height: 60px;
  }

  .horizontal-track-wrapper {
    padding: 10px 20px 20px;
  }

  .horizontal-slide-item {
    width: 280px;
    padding: 20px;
  }
}


@media (max-width: 768px) {
  .premium-cutaway-img {
    height: 300px !important;
  }
}

/* ==========================================================================
   BULLETPROOF MOBILE RESPONSIVE PATCH
   Ensures perfect UI scaling on small devices (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Typography Scaling */
  h1, .display-title-1, .ci-title, .theme-heading {
    font-size: clamp(2rem, 8vw, 2.5rem) !important;
    line-height: 1.2 !important;
  }
  h2, .display-title-2 {
    font-size: clamp(1.8rem, 6vw, 2.2rem) !important;
  }
  h3, .display-title-3 {
    font-size: clamp(1.5rem, 5vw, 1.8rem) !important;
  }
  p, .about-desc, .article-content p {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }

  /* 2. Section Padding Reductions */
  .section-dark, .section-light, .creative-inner-hero, .about-section, section {
    padding-top: clamp(40px, 8vw, 60px) !important;
    padding-bottom: clamp(40px, 8vw, 60px) !important;
  }
  .creative-inner-hero {
    padding-top: calc(var(--header-height) + 30px) !important;
  }

  /* 3. Right Side Arch Window Scaling (Inner Pages) */
  .ci-visual-composition {
    height: 320px !important;
    margin-top: 40px;
  }
  .ci-arch-window {
    width: 220px !important;
    height: 300px !important;
    border-radius: 110px 110px 15px 15px !important;
  }
  .ci-arch-lifestyle {
    border-radius: 110px 110px 15px 15px !important;
  }
  .ci-float-card {
    transform: scale(0.85);
  }

  /* 4. Contact Page Specifier Form */
  .specifier-canvas-container {
    padding: 24px !important;
    border-radius: 12px !important;
  }
  .radar-visual-card {
    padding: 20px !important;
  }

  /* 5. Footer Layout Adjustments */
  .ultra-footer {
    padding-top: 60px !important;
  }
  .footer-overlap-cta {
    padding: 40px 20px !important;
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  .footer-overlap-cta h2 {
    font-size: 1.8rem !important;
  }
  .footer-links-col, .footer-contact-col, .footer-brand-col {
    margin-bottom: 30px;
    text-align: center;
  }
  .footer-links-col ul, .footer-contact-col ul, .social-magnetic {
    justify-content: center;
    align-items: center;
  }
  .footer-watermark {
    font-size: 25vw !important; /* Scale watermark cleanly */
  }

  /* 6. General Layout Fixes */
  .container {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .hero-slider .premium-cutaway-img {
    height: 300px !important;
  }
}

/* Extra Small Devices (< 576px) */
@media (max-width: 576px) {
  .ci-arch-window {
    width: 200px !important;
    height: 280px !important;
    border-radius: 100px 100px 15px 15px !important;
  }
  .ci-arch-lifestyle {
    border-radius: 100px 100px 15px 15px !important;
  }
  .search-input-field {
    font-size: 1.5rem !important;
  }
  .specifier-canvas-container .row > div {
    margin-bottom: 15px; /* Add spacing to stacked form inputs */
  }
}


/* --- Fixes for Header Visibility & Space Issues --- */
@media (max-width: 991.98px) {
  /* Enforce header actions visibility on mobile */
  .header-actions {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  .btn-mobile-toggle, .btn-icon-search {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Fix the massive empty space on Home Page Hero */
  .bright-stage {
    height: 350px !important;
  }
}

@media (max-width: 768px) {
  .bright-stage {
    height: 320px !important;
  }
  /* Reduce margin below the image on mobile */
  .order-1.order-lg-2.mb-5 {
    margin-bottom: 1.5rem !important; /* Overrides mb-5 (3rem) to be much smaller */
  }
  /* Fix inner page hero composition heights to avoid empty space */
  .ci-visual-composition {
    height: 300px !important;
    margin-top: 20px !important;
  }
}


/* --- Fix for Horizontal Scroll on Mobile --- */
html, body {
  overflow-x: hidden !important;
  width: 100%;
  position: relative;
}

@media (max-width: 768px) {
  /* Fix huge font sizes that might cause horizontal overflow */
  h1, .display-title-1, .ci-title, .theme-heading, .hero-title-main {
    font-size: clamp(2rem, 8vw, 2.5rem) !important;
    line-height: 1.2 !important;
    word-break: break-word;
  }
}

/* --- Fix for Header Overlay / Clickability Issue --- */
.mars-header {
  z-index: 10000 !important;
}
.header-actions {
  position: relative !important;
  z-index: 10001 !important;
  pointer-events: auto !important;
}
.btn-icon-search, .btn-mobile-toggle, .btn-mars {
  position: relative !important;
  z-index: 10002 !important;
  pointer-events: auto !important;
}


/* --- Fix for Hero overlapping Header on Mobile --- */
@media (max-width: 991.98px) {
  .hero-bright {
    display: block !important;
    padding-top: 120px !important; 
  }
  .hero-bright .row {
    align-items: flex-start !important;
  }
}

/* --- Inner Page Buttons Side-by-Side --- */
@media (max-width: 768px) {
  .ci-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .ci-actions .btn-dark-pill {
    flex: 1 1 50% !important;
    padding: 10px 4px !important;
    font-size: 0.65rem !important;
    text-align: center !important;
    white-space: nowrap !important;
    justify-content: center !important;
  }
}

/* --- Mobile UI Fixes: Hero Spacing & Features Banner --- */
@media (max-width: 768px) {
  /* Fix spacing between Hero and Categories */
  .hero-bright {
    padding-bottom: 20px !important;
  }
  .hero-bright .min-vh-60 {
    min-height: auto !important;
  }
  .bright-section {
    padding-top: 10px !important;
  }

  /* Premium Mobile UI for Features Banner (Below Categories) */
  .fb-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100%;
  }
  .fb-item {
    display: grid !important;
    grid-template-columns: 45px 1fr !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    text-align: left !important;
    gap: 0 12px !important;
    background: rgba(255,255,255,0.02);
    padding: 12px 15px !important;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
  }
  .fb-item .fb-icon {
    grid-row: 1 / span 2;
    margin: 0 !important;
    width: 35px !important;
    height: 35px !important;
  }
  .fb-item h4 {
    grid-row: 1;
    align-self: flex-end;
    font-size: 0.9rem !important;
    color: #fff !important;
    margin-bottom: 2px !important;
  }
  .fb-item p {
    grid-row: 2;
    align-self: flex-start;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    color: #999 !important;
    margin: 0 !important;
  }
}

/* Mobile UI for OUR CATEGORIES */
@media (max-width: 768px) {
  .categories-inline-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  .categories-inline-row > .ci-info {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 10px;
  }
  .categories-inline-row > .soft-cat-card {
    height: 180px !important;
    border-radius: 10px;
  }
  .categories-inline-row .scc-info h3 {
    font-size: 1rem !important;
    margin-bottom: 2px !important;
  }
  .categories-inline-row .scc-info span {
    font-size: 0.65rem !important;
  }
}


/* Mobile UI for About Us Section */
@media (max-width: 768px) {
  .about-section {
    padding: 60px 0 !important;
    overflow-x: hidden;
  }
  .about-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  .about-images-wrapper {
    height: 380px !important;
    width: 100% !important;
  }
  .about-checks {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 25px !important;
  }
  .about-checks li {
    font-size: 0.8rem !important;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .about-stats-row {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 15px 10px !important;
    margin-top: 30px !important;
    justify-content: flex-start !important;
    width: 100% !important;
  }
  .stat-item {
    flex: 1 1 45% !important;
    max-width: 50% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 !important;
  }
  .stat-circle-svg {
    width: 65px !important;
    height: 65px !important;
  }
  .circle-inner-text {
    font-size: 1.1rem !important;
  }
  .circle-inner-text span {
    font-size: 0.7rem !important;
  }
  .stat-text {
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
    color: #ccc !important;
  }
  .theme-heading {
    font-size: 2rem !important;
  }
}
/* Mobile UI Fixes for Explore Range & Inspiration */
@media (max-width: 768px) {
  /* Fix container-fluid huge padding on mobile */
  .container-fluid.px-5 {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Explore Range: Our Collections - One card per row, smaller size */
  .collection-card {
    padding: 20px 15px !important;
    max-width: 320px !important;
    margin: 0 auto;
  }
  .collection-img-wrap {
    height: 150px !important;
    margin: 15px 0 20px !important;
  }
  /* Force col-sm-6 to be 100% width on mobile if it isn't already */
  .row.g-4 > [class*="col-"] {
    width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* Bathroom Inspiration Mobile Responsiveness */
  .inspire-inline-row {
    grid-template-columns: 1fr !important; /* Stack vertically */
    gap: 15px !important;
  }
  .inspire-inline-row .ii-info {
    padding-right: 0 !important;
    text-align: center;
    align-items: center !important;
    margin-bottom: 15px;
  }
  .ii-img-wrap {
    height: 250px !important; /* Shorter images so they fit nicely */
    border-radius: 12px !important;
  }
}

/* Mobile UI for Footer CTA */
@media (max-width: 768px) {
  .footer-overlap-cta {
    position: relative !important;
    top: 0 !important;
    margin-bottom: 40px !important;
    flex-direction: column !important;
    text-align: center;
    padding: 30px 20px !important;
    gap: 20px !important;
    border-radius: 20px !important;
    width: auto !important;
    left: 0 !important;
    right: 0 !important;
  }
  .footer-overlap-cta h2 {
    font-size: 1.5rem !important;
  }
  .footer-overlap-cta .btn-glow-blue {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile UI for Contact Page Body */
@media (max-width: 768px) {
  .creative-inner-hero {
    padding-top: 100px !important;
  }
  .ci-title {
    font-size: 2.2rem !important;
  }
  
  #specifierSection {
    padding-top: 50px !important;
    padding-bottom: 60px !important;
    overflow-x: hidden !important; /* Prevent any horizontal overflow */
  }
  .specifier-canvas-container,
  .radar-visual-card {
    padding: 25px 20px !important;
  }
  .display-title-3 {
    font-size: 1.5rem !important;
  }
  
  .specifier-chips-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .btn-spec-chip {
    flex: 1 1 auto !important;
    text-align: center !important;
    padding: 10px 14px !important;
    font-size: 0.75rem !important;
  }
  .specifier-step-label {
    font-size: 0.9rem !important;
  }
  .spec-input-clean {
    font-size: 0.9rem !important;
  }
  
  .radar-node-item {
    flex-direction: row !important; /* keep row but shrink text if needed */
    flex-wrap: wrap;
    gap: 10px;
  }
  .radar-node-item .h6 {
    font-size: 0.9rem !important;
  }
}

/* Mobile UI for Innovation Marquee (Feature Pills) */
@media (max-width: 768px) {
  .features-marquee-section {
    padding: 50px 0 40px 0 !important;
  }
  .features-marquee-section h2 {
    font-size: 1.8rem !important;
    margin-bottom: 30px !important;
  }
  .premium-feature-pill {
    width: 100px !important;
    height: 135px !important;
    border-radius: 50px !important;
    gap: 12px !important;
  }
  .premium-feature-pill img {
    height: 40px !important;
  }
  .pill-label {
    font-size: 0.55rem !important;
  }
  .premium-marquee-track {
    gap: 15px !important;
  }
}

/* Extra Fixes for About Page Text Visibility */
@media (max-width: 768px) {
  /* Prevent horizontal squeeze on the 3 metrics */
  .section-dark .d-flex.gap-4 {
    gap: 15px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  .section-dark .d-flex.gap-4 > div {
    text-align: center;
  }
  /* Remove the vertical divider on mobile if it wraps */
  .section-dark .d-flex.gap-4 > div[style*="width: 1px"] {
    display: none !important;
  }
}

/* Automated Production Hub Mobile Text Fix */
@media (max-width: 768px) {
  .display-title-2 {
    font-size: 1.6rem !important; /* Smaller to prevent 'INFRASTRUCTURE' cut-off */
    word-wrap: break-word !important;
  }
  .section-dark h3.h5 {
    font-size: 1.1rem !important;
    word-wrap: break-word !important;
  }
}

/* Collection Card text mobile fix */
@media (max-width: 768px) {
  .collection-card .d-flex.justify-content-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .collection-link {
    font-size: 0.85rem !important;
    width: 100%;
    text-align: left;
  }
}

/* Mobile UI for Premium Matrix */
@media (max-width: 991px) {
  .premium-matrix-container {
    background: transparent;
    border: none;
    box-shadow: none;
  }
  .matrix-row {
    display: flex;
    flex-direction: column;
    padding: 25px !important;
    background: #ffffff;
    border-radius: 16px;
    margin-bottom: 15px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    gap: 12px;
  }
  .matrix-row:hover {
    transform: translateY(-5px);
  }
  .mr-col {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .mr-title {
    flex-direction: column;
    align-items: flex-start !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 15px;
    margin-bottom: 5px;
  }
  .mr-title strong {
    font-size: 1.3rem;
  }
  .mobile-label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 700;
  }
  .mr-col.text-lg-end {
    justify-content: center;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 20px;
    margin-top: 5px;
  }
  .btn-matrix-action {
    background: #000;
    color: #fff;
    width: 100%;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
  }
  .btn-matrix-action:hover {
    background: #b68663;
    color: #fff;
  }
}
