/* ==========================================================================
   PLUS Point - Responsive Grid & Media Queries
   ========================================================================== */

/* Large screens (Desktops & Wide screens) */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }
}

/* Medium desktops / Laptops */
@media (max-width: 1200px) {
  :root {
    --section-padding: 80px 0;
  }

  .section-title {
    font-size: 2.4rem;
  }

  .nav-menu {
    gap: 20px;
  }

  .footer-top {
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  }
}

/* Tablets Landscape & Portrait (Laptops under 1024px) */
@media (max-width: 1024px) {
  :root {
    --header-height: 75px;
    --section-padding: 70px 0;
  }

  /* Navigation: Hide desktop menu, show hamburger */
  .nav-menu {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .logo-main {
    font-size: 1.6rem;
  }

  .section-title {
    font-size: 2.2rem;
  }

  /* Grid Layout Fallbacks/Conversions */
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer-col:first-child {
    grid-column: span 2;
  }

  .footer-col:last-child {
    grid-column: span 2;
  }

  /* Hide custom cursor on tablets and mobiles for better performance */
  .custom-cursor, .custom-cursor-ring {
    display: none !important;
  }
  
  .use-custom-cursor {
    cursor: auto !important;
  }

  .about-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablets Portrait (Under 768px) */
@media (max-width: 768px) {
  :root {
    --section-padding: 60px 0;
  }

  /* Hide call, whatsapp, and search buttons in header actions on mobile */
  .header-actions .search-toggle,
  .header-actions .btn-call,
  .header-actions .btn-whatsapp {
    display: none !important;
  }

  /* Mobile Sticky Actions Bar visible on mobile only */
  .mobile-sticky-actions {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: var(--white) !important;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1) !important;
    z-index: 9999 !important;
    padding: 10px 16px !important;
    gap: 12px !important;
    border-top: 1px solid var(--gray-light) !important;
  }

  .sticky-action-btn {
    flex: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    min-height: 48px !important;
  }

  .btn-call-sticky {
    background-color: var(--primary) !important;
    color: var(--white) !important;
    border: 1px solid var(--primary) !important;
  }

  .btn-whatsapp-sticky {
    background-color: var(--whatsapp) !important;
    color: var(--white) !important;
    border: 1px solid var(--whatsapp) !important;
  }

  /* Move back-to-top button up on mobile to clear the sticky actions */
  .back-to-top {
    bottom: 85px !important;
  }

  /* Add padding bottom to body on mobile so content isn't covered by sticky actions */
  body {
    padding-bottom: 70px !important;
  }

  .section-title {
    font-size: 1.9rem;
  }

  .section-header {
    margin-bottom: 40px;
  }

  /* Hero section adjustments */
  .floating-card {
    display: none !important;
  }

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

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

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 15px;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  /* About section layout change */
  .about-split {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  .about-narrative-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-narrative-grid > div:first-child {
    order: 2;
  }

  .about-narrative-grid > div:last-child {
    order: 1;
  }

  .about-team-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* Category Tabs Responsive Flex-Grid on Mobile */
  .category-tabs-container {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 30px !important;
    overflow-x: visible !important;
  }

  .category-tab {
    flex: 1 1 calc(50% - 10px) !important;
    max-width: calc(50% - 5px) !important;
    text-align: center !important;
    padding: 12px 10px !important;
    font-size: 0.8rem !important;
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Why Choose Us details */
  .why-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Products and categories grid */
  .products-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Statistics grid */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 30px !important;
  }

  /* Service grid */
  .services-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Timeline Responsive Stack */
  .timeline-line {
    left: 20px !important;
    transform: translateX(-50%) !important;
  }

  .timeline-item {
    width: 100% !important;
    left: 0 !important;
    padding-left: 50px !important;
    padding-right: 0 !important;
    text-align: left !important;
    margin-bottom: 40px !important;
  }

  .timeline-badge {
    left: 20px !important;
    right: auto !important;
    margin-left: -15px !important;
  }

  /* Contact page layout split */
  .contact-split {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
}

/* Mobile Devices (Under 576px) */
@media (max-width: 576px) {
  :root {
    --section-padding: 50px 0;
  }

  .container {
    padding: 0 16px;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .section-desc {
    font-size: 0.95rem;
  }

  /* Grid Layouts Stacked */
  .why-grid {
    grid-template-columns: 1fr !important;
  }

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

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

  .product-actions {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
  }

  .product-actions span {
    text-align: center;
  }

  .product-actions .btn-whatsapp {
    width: 100%;
    justify-content: center;
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
  }

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

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

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

  .footer-col:first-child,
  .footer-col:last-child {
    grid-column: span 1;
  }

  /* Gallery columns */
  .gallery-grid {
    column-count: 1 !important;
  }

  .mobile-nav-drawer {
    max-width: 100%;
    padding: 90px 24px 24px 24px;
  }

  .mobile-nav-link, .mobile-dropdown-btn {
    font-size: 1.3rem;
  }

  /* Testimonials and slider buttons */
  .slider-nav {
    display: none !important;
  }

  .slider-dots {
    margin-top: 15px !important;
  }
}

/* Touch targets optimization */
@media (pointer: coarse) {
  .btn, .nav-link, .dropdown-link, .mobile-nav-link, .search-toggle,
  input, textarea, select, .form-control {
    min-height: 48px;
  }
}
