/* ==========================================================================
   RAJ KUMAR TEXTILE - MASTER RESPONSIVE DESIGN SYSTEM & BREAKPOINTS
   ========================================================================== */

/* GLOBAL RESPONSIVE SAFETY RESETS */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

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

/* 1. ULTRA-WIDE & LARGE DESKTOPS (>= 1440px) */
@media (min-width: 1440px) {
  .container {
    max-width: 1360px;
  }
}

/* 2. LAPTOPS (1200px - 1439px) */
@media (max-width: 1439px) and (min-width: 1200px) {
  .horizontal-timeline-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
  }

  .horizontal-timeline-box {
    padding: 1.85rem 1.35rem !important;
  }
}

@media (max-width: 1200px) {
  .mega-menu {
    width: 700px;
    left: -150px;
    grid-template-columns: repeat(3, 1fr);
  }
  .mega-menu-banner {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 2rem;
  }
  .hero-title {
    font-size: 3.2rem;
  }
  .legacy-grid,
  .trousseau-grid {
    gap: 3rem !important;
  }
  .why-us-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.75rem !important;
  }
}

/* 3. TABLETS (768px - 1199px) - 2x2 TIMELINE GRID ADAPTATION */
@media (max-width: 1199px) {
  .horizontal-timeline-line {
    display: none !important;
  }

  .horizontal-timeline-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem 1.5rem !important;
  }

  .horizontal-timeline-card {
    align-items: center !important;
    text-align: center !important;
  }

  .horizontal-timeline-node {
    margin-bottom: 1.25rem !important;
  }

  .horizontal-timeline-box {
    height: 100% !important;
    padding: 2rem 1.5rem !important;
    justify-content: flex-start !important;
  }

  .contact-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  .contact-form-layout {
    grid-template-columns: 1fr !important;
    gap: 2.25rem !important;
  }
}

/* 4. TABLETS PORTRAIT & MOBILE NAVIGATION (<= 992px) */
@media (max-width: 992px) {
  .top-bar-tagline {
    display: none !important;
  }

  .nav-menu {
    display: none !important;
  }

  .mobile-menu-toggle {
    display: flex !important;
  }

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

  .legacy-grid,
  .trousseau-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .legacy-img,
  .trousseau-img-wrap {
    height: 380px !important;
  }

  .why-us-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  .bespoke-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  .bespoke-timeline-line {
    display: none !important;
  }

  .fp-stage-wrap {
    height: 570px !important;
  }

  .fp-item {
    flex: 0 0 340px !important;
    width: 340px !important;
    height: 500px !important;
  }

  .products-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.75rem !important;
  }

  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2.5rem !important;
  }
}

/* 5. MOBILE DEVICES (320px - 767px) - VERTICAL TIMELINE REDESIGN */
@media (max-width: 767px) {
  :root {
    --section-padding-y: 50px;
    --header-height: 110px;
  }

  .brand-logo-img {
    height: 110px !important;
    max-height: 120px !important;
    transform: scale(1.2) !important;
    transform-origin: left center !important;
  }

  .footer-logo-img {
    height: 130px !important;
    transform: scale(1.15) !important;
    transform-origin: left center !important;
  }

  .hero-section {
    height: auto !important;
    min-height: 520px !important;
    padding: 95px 0 55px !important;
  }

  .hero-title {
    font-size: 2.5rem !important;
    line-height: 1.25 !important;
  }

  .section-header h2 {
    font-size: 1.95rem !important;
  }

  .legacy-title {
    font-size: 2.05rem !important;
  }

  .trousseau-title {
    font-size: 1.9rem !important;
  }

  /* --- VERTICAL TIMELINE REDESIGN FOR MOBILE --- */
  .horizontal-timeline-wrap {
    padding-left: 2.25rem !important;
    padding-right: 0.5rem !important;
    position: relative !important;
    max-width: 420px !important;
    margin: 2rem auto 0 !important;
  }

  .horizontal-timeline-wrap::before {
    content: '' !important;
    position: absolute !important;
    top: 18px !important;
    bottom: 18px !important;
    left: 14px !important;
    width: 3px !important;
    background: linear-gradient(180deg, #C9A15D 0%, rgba(201, 161, 93, 0.25) 100%) !important;
    box-shadow: 0 0 10px rgba(201, 161, 93, 0.3) !important;
    border-radius: 2px !important;
    z-index: 1 !important;
  }

  .horizontal-timeline-line {
    display: none !important;
  }

  .horizontal-timeline-grid {
    grid-template-columns: 1fr !important;
    gap: 1.85rem !important;
    position: relative !important;
    z-index: 2 !important;
  }

  .horizontal-timeline-card {
    align-items: flex-start !important;
    text-align: left !important;
    position: relative !important;
    width: 100% !important;
  }

  .horizontal-timeline-node {
    position: absolute !important;
    left: -2.25rem !important;
    top: 20px !important;
    width: 22px !important;
    height: 22px !important;
    border-width: 3px !important;
    margin-bottom: 0 !important;
    z-index: 3 !important;
  }

  .horizontal-timeline-box {
    align-items: flex-start !important;
    text-align: left !important;
    padding: 1.65rem 1.35rem !important;
    width: 100% !important;
    border-radius: 20px !important;
  }

  .timeline-year-pill {
    align-self: flex-start !important;
    margin-bottom: 0.65rem !important;
  }

  /* Contact Page Mobile Overrides */
  .contact-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .form-row-2 {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .contact-hero-cta-wrap {
    flex-direction: column !important;
    width: 100% !important;
  }

  .contact-hero-cta-wrap .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* 3D Showcase Carousel for Mobile */
  .fp-container {
    padding: 0 1rem !important;
  }

  .fp-stage-wrap {
    height: 490px !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }

  .fp-carousel {
    gap: 16px !important;
  }

  .fp-item {
    flex: 0 0 290px !important;
    width: 290px !important;
    height: 440px !important;
  }

  .fp-item.fp-center {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
    filter: none !important;
    z-index: 10 !important;
  }

  .fp-item.fp-side {
    transform: scale(0.92) translateY(0) !important;
    opacity: 0.35 !important;
    filter: blur(2px) !important;
    z-index: 5 !important;
  }

  .testimonial-stage-wrap {
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }

  .testimonial-card {
    flex: 0 0 300px !important;
    width: 300px !important;
    padding: 1.75rem 1.35rem !important;
  }

  .modal-container {
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 1.5rem !important;
  }

  .quick-view-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

/* 6. MOBILE SMARTPHONES (<= 576px) */
@media (max-width: 576px) {
  :root {
    --section-padding-y: 45px;
  }

  .container,
  .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .top-bar {
    display: none !important;
  }

  .site-header {
    top: 0 !important;
    height: 68px !important;
  }

  .site-brand-logo {
    font-size: 1.35rem !important;
    letter-spacing: 0.08em !important;
  }

  .hero-title {
    font-size: 2.15rem !important;
  }

  .hero-subtitle {
    font-size: 0.92rem !important;
  }

  .hero-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .hero-actions .btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .bespoke-header h2 {
    font-size: 1.85rem !important;
  }

  .bespoke-grid,
  .why-us-grid,
  .products-grid,
  .catalog-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .bespoke-card,
  .why-us-card {
    padding: 1.5rem 1.15rem !important;
  }

  .legacy-img {
    height: 280px !important;
  }

  .floating-actions {
    bottom: 1rem !important;
    left: 1rem !important;
    gap: 0.5rem !important;
  }

  .floating-btn {
    width: 42px !important;
    height: 42px !important;
    font-size: 1rem !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 1.85rem !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    gap: 0.85rem !important;
    text-align: center !important;
  }
}

/* 7. TINY SMARTPHONES (<= 380px) */
@media (max-width: 380px) {
  .hero-title {
    font-size: 1.85rem !important;
  }

  .section-header h2 {
    font-size: 1.65rem !important;
  }

  .legacy-title,
  .trousseau-title {
    font-size: 1.55rem !important;
  }

  .fp-item {
    flex: 0 0 260px !important;
    width: 260px !important;
    height: 420px !important;
  }

  .fp-stage-wrap {
    height: 460px !important;
  }

  .fp-card-title {
    font-size: 1.15rem !important;
  }
}
