/* ================================================================
   RESPONSIVE.CSS — Ali's Panaflex Website
   Full Device Coverage: 280px (Nokia) → 1920px+ (TV / 4K)
   Mobile-First Approach
   ================================================================ */

/* ----------------------------------------------------------------
   1. GLOBAL BASE — Prevent overflow, ensure box-sizing
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  min-width: 280px;
}

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

/* ----------------------------------------------------------------
   2. NAVIGATION — All Devices
   ---------------------------------------------------------------- */

/* Prevent logo text overflow on very small phones (280–340px) */
@media (max-width: 360px) {
  nav h2 {
    font-size: 0.95rem !important;
  }
  nav .size-8 {
    width: 1.75rem !important;
    height: 1.75rem !important;
  }
  nav .gap-4 {
    gap: 0.5rem !important;
  }
  /* Make mobile menu button larger touch target */
  #mobile-menu-button {
    padding: 0.625rem !important;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Mobile menu — full-width links, easy touch targets */
#mobile-menu a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Large screens — wider nav padding */
@media (min-width: 1536px) {
  nav .max-w-7xl {
    max-width: 1400px !important;
  }
}

/* ----------------------------------------------------------------
   3. PROMO BANNER — Responsive text & height
   ---------------------------------------------------------------- */
.promo-banner {
  min-height: 36px;
}

@media (max-width: 480px) {
  .promo-banner {
    font-size: 0.7rem !important;
  }
  .promo-track span.flex {
    gap: 0.4rem !important;
  }
  .promo-track .material-symbols-outlined {
    font-size: 14px !important;
  }
}

@media (min-width: 1440px) {
  .promo-banner {
    font-size: 0.9rem;
  }
}

/* ----------------------------------------------------------------
   4. HERO SECTION — index.html
   ---------------------------------------------------------------- */

/* Fluid hero h1 across all devices */
.hero-h1-fluid {
  font-size: clamp(1.6rem, 5vw, 4rem) !important;
  line-height: 1.15 !important;
}

/* Hero buttons — full width on tiny phones, auto on sm+ */
.hero-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .hero-cta-buttons a {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Hero slider — adjust aspect on small phones */
@media (max-width: 480px) {
  .hero-slider {
    aspect-ratio: 4 / 3 !important;
    max-height: 260px;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  .hero-slider {
    aspect-ratio: 16 / 9 !important;
  }
}

/* Hero layout — stack on mobile, side-by-side on md+ */
@media (max-width: 767px) {
  .hero-img-side {
    width: 100% !important;
    margin-top: 1.5rem;
  }
}

/* Floating hero badge — don't show on very small phones */
@media (max-width: 360px) {
  .pulse-badge {
    display: none !important;
  }
}

/* Decorative float icons — hide on mobile to reduce clutter */
@media (max-width: 767px) {
  .float-slow,
  .float-slower {
    display: none !important;
  }
}

/* ----------------------------------------------------------------
   5. MEGA SALE / COUNTDOWN SECTION
   ---------------------------------------------------------------- */
.countdown-box {
  min-width: 52px !important;
}

@media (max-width: 360px) {
  .countdown-box {
    min-width: 44px !important;
    padding: 0.5rem 0.25rem !important;
  }
  .countdown-box .text-2xl,
  .countdown-box .text-3xl {
    font-size: 1.2rem !important;
  }
  .countdown-box p {
    font-size: 0.55rem !important;
  }
}

@media (max-width: 480px) {
  /* Sale section heading */
  .sale-card h2 {
    font-size: clamp(1.5rem, 6vw, 2.5rem) !important;
  }
  /* Countdown wrap */
  .countdown-wrap {
    gap: 0.375rem !important;
  }
}

/* Claim button — full width on mobile */
@media (max-width: 639px) {
  .sale-claim-btn {
    width: 100% !important;
  }
}

/* ----------------------------------------------------------------
   6. SERVICE CARDS GRID
   ---------------------------------------------------------------- */

/* Ensure service cards have consistent height within a row */
.services-grid .group {
  height: 100%;
}

/* Card images — prevent stretching on large screens */
.services-grid .aspect-video {
  max-height: 200px;
}

@media (min-width: 1536px) {
  .services-grid .aspect-video {
    max-height: 220px;
  }
}

/* ----------------------------------------------------------------
   7. STATS COUNTER SECTION
   ---------------------------------------------------------------- */
@media (max-width: 360px) {
  .counter-box {
    padding: 1.25rem 0.75rem !important;
  }
  .counter-num {
    font-size: 1.75rem !important;
  }
}

/* Portfolio stats section */
@media (max-width: 360px) {
  .stat-num-big {
    font-size: 2rem !important;
  }
}

/* ----------------------------------------------------------------
   8. "WHY CHOOSE US" SECTION
   ---------------------------------------------------------------- */

/* Floating review badge — hide on very small screens */
@media (max-width: 480px) {
  .why-choose-float-card {
    display: none !important;
  }
}

/* Image side — full width on mobile */
@media (max-width: 767px) {
  .why-choose-img-wrap {
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* ----------------------------------------------------------------
   9. PORTFOLIO / WORK STRIP
   ---------------------------------------------------------------- */

/* Strip images — smaller on tiny phones */
@media (max-width: 480px) {
  .portfolio-strip-track a {
    width: 180px !important;
    height: 120px !important;
  }
}

/* Portfolio masonry grid */
.portfolio-gallery-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .portfolio-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .portfolio-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .portfolio-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Portfolio hero image grid — hide on mobile, show on lg */
@media (max-width: 1023px) {
  .portfolio-hero-img-grid {
    display: none !important;
  }
}

/* Filter tabs — scrollable on small screens */
.filter-tabs-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0.25rem;
}

.filter-tabs-wrap::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   10. CONTACT PAGE
   ---------------------------------------------------------------- */

/* Contact hero info grid — single col on tiny phones */
@media (max-width: 400px) {
  .contact-info-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Contact section padding */
@media (max-width: 767px) {
  .contact-main-section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-top: 2.5rem !important;
    padding-bottom: 3rem !important;
  }
}

/* Contact form — ensure full width inputs */
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100% !important;
  min-width: 0 !important;
}

/* Map embed — responsive height */
.map-embed-wrap {
  height: 200px;
}

@media (min-width: 768px) {
  .map-embed-wrap {
    height: 240px;
  }
}

/* ----------------------------------------------------------------
   11. QUOTE PAGE
   ---------------------------------------------------------------- */

/* Quote form — single col on mobile */
@media (max-width: 767px) {
  .quote-form-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Quote sidebar — stack below form on mobile */
@media (max-width: 1023px) {
  .quote-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Quote form main area — full width on mobile */
@media (max-width: 1023px) {
  #main-content.quote-main {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* Submit button — full width on mobile */
@media (max-width: 639px) {
  #quoteSubmitBtn {
    width: 100% !important;
  }
}

/* File upload area — adjust height */
@media (max-width: 480px) {
  .file-upload-area {
    height: 6rem !important;
  }
}

/* ----------------------------------------------------------------
   12. FOOTER — All Pages
   ---------------------------------------------------------------- */

/* Footer grid — stack to 1 col on mobile, 2 on sm, 3 on md */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Footer bottom bar — center on mobile */
@media (max-width: 767px) {
  .footer-bottom {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.75rem !important;
  }
}

/* Footer map height */
@media (max-width: 767px) {
  .footer-map {
    height: 140px !important;
  }
}

/* ----------------------------------------------------------------
   13. WHATSAPP FLOATING BUTTON
   ---------------------------------------------------------------- */

/* Move WA button up on very small phones so it doesn't overlap content */
@media (max-width: 375px) {
  .wa-float-btn {
    bottom: 1rem !important;
    right: 0.75rem !important;
    width: 3rem !important;
    height: 3rem !important;
  }
  .wa-float-btn .material-symbols-outlined {
    font-size: 1.5rem !important;
  }
}

/* Tooltip always off on touch devices */
@media (hover: none) {
  .wa-float-btn .absolute {
    display: none !important;
  }
}

/* ----------------------------------------------------------------
   14. REVIEW / TESTIMONIAL CAROUSEL
   ---------------------------------------------------------------- */

/* On desktop, show 2 cards side by side */
@media (min-width: 768px) {
  .review-card {
    min-width: 50% !important;
  }
}

/* Review card inner — reduce padding on small phones */
@media (max-width: 480px) {
  .review-card > div {
    padding: 1.5rem 1rem !important;
  }
}

/* ----------------------------------------------------------------
   15. SERVICES.HTML — Services Page Hero Image Grid
   ---------------------------------------------------------------- */

/* Hide hero image grid on mobile/tablet, show on lg+ */
@media (max-width: 1023px) {
  .services-hero-img-grid {
    display: none !important;
  }
}

/* Services hero — center text on mobile */
@media (max-width: 1023px) {
  .services-hero-text {
    text-align: center;
    align-items: center;
  }
  .services-hero-text .flex-wrap {
    justify-content: center;
  }
  .services-hero-text .flex-wrap.gap-6 {
    justify-content: center;
  }
}

/* ----------------------------------------------------------------
   16. PROCESS STEPS
   ---------------------------------------------------------------- */

/* On small mobile, process steps in 1 col */
@media (max-width: 479px) {
  .process-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ----------------------------------------------------------------
   17. LARGE SCREEN / TV ENHANCEMENTS (1536px+)
   ---------------------------------------------------------------- */

@media (min-width: 1536px) {
  /* Wider max container for TV/4K */
  .max-w-7xl {
    max-width: 1536px !important;
  }
  .layout-content-container {
    max-width: 1536px !important;
  }

  /* Larger base font */
  body {
    font-size: 1.0625rem;
  }

  /* Hero heading */
  .tv-hero-h1 {
    font-size: 4.5rem !important;
  }

  /* Nav links */
  nav a {
    font-size: 1rem !important;
  }

  /* Section padding boost */
  .py-16 { padding-top: 5rem; padding-bottom: 5rem; }
  .py-24 { padding-top: 7rem; padding-bottom: 7rem; }
}

@media (min-width: 1920px) {
  .max-w-7xl,
  .layout-content-container {
    max-width: 1800px !important;
  }

  /* Services grid — 4 or 5 cols at ultra-wide */
  .services-grid-xl {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* ----------------------------------------------------------------
   18. GLOBAL SECTION PADDING — Tablet & Mobile
   ---------------------------------------------------------------- */

@media (max-width: 767px) {
  /* Reduce vertical section padding on mobile */
  section.py-16 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  section.py-20 {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }
  section.py-24 {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }

  /* Add breathing room between grid items */
  .grid.gap-6 {
    gap: 1rem !important;
  }
  .grid.gap-8 {
    gap: 1.25rem !important;
  }
  .grid.gap-10 {
    gap: 1.5rem !important;
  }
}

/* Intermediate breakpoint — 480px to 767px */
@media (min-width: 480px) and (max-width: 767px) {
  section.py-16 {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }
}

/* ----------------------------------------------------------------
   19. FLUID TYPOGRAPHY — Headings across all pages
   ---------------------------------------------------------------- */

/* Section h2 headings */
.section-h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem) !important;
  line-height: 1.2 !important;
}

/* Hero h1 */
.page-hero-h1 {
  font-size: clamp(1.75rem, 5vw, 3.5rem) !important;
  line-height: 1.1 !important;
}

/* ----------------------------------------------------------------
   20. TOUCH & ACCESSIBILITY IMPROVEMENTS
   ---------------------------------------------------------------- */

/* Minimum touch target size (44×44px) for interactive elements */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Better tap highlighting */
a, button {
  -webkit-tap-highlight-color: rgba(225, 6, 0, 0.15);
}

/* Improve focus visibility on all devices */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #E10600 !important;
  outline-offset: 2px !important;
}

/* ----------------------------------------------------------------
   21. PRINT MEDIA — Clean print styles
   ---------------------------------------------------------------- */
@media print {
  .promo-banner,
  nav,
  .wa-float-btn,
  footer {
    display: none !important;
  }
  body {
    font-size: 12pt;
    color: #000;
  }
}

/* ----------------------------------------------------------------
   22. ANIMATION REDUCTION — Respect user preferences
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .promo-track {
    animation: none !important;
  }
  .portfolio-strip-track {
    animation: none !important;
  }
}

/* ----------------------------------------------------------------
   23. HIGH-DPI / RETINA DISPLAY
   ---------------------------------------------------------------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharp borders on retina */
  nav,
  .hero-slider {
    border-width: 0.5px;
  }
}

/* ----------------------------------------------------------------
   24. LANDSCAPE PHONE FIXES
   ---------------------------------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  /* Hero section — compact on landscape phones */
  header.relative {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  .hero-slider {
    max-height: 200px !important;
  }
  /* Reduce promo banner height */
  .promo-banner {
    padding-top: 0.35rem !important;
    padding-bottom: 0.35rem !important;
    font-size: 0.65rem !important;
  }
}

/* ----------------------------------------------------------------
   25. SAFARI IOS FIXES
   ---------------------------------------------------------------- */

/* Fix 100vh on iOS Safari */
.min-h-screen {
  min-height: 100dvh;
}

/* Fix input zoom on iOS — font-size must be >= 16px */
@media (max-width: 767px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ----------------------------------------------------------------
   26. SECTION PADDING HORIZONTAL — All Device Widths
   ---------------------------------------------------------------- */

/* xs: 280-479px */
@media (max-width: 479px) {
  .section-px {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .px-4 {
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
  }
}

/* sm: 480-639px */
@media (min-width: 480px) and (max-width: 639px) {
  .section-px {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* md: 640-767px */
@media (min-width: 640px) and (max-width: 767px) {
  .section-px {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* xl: 1280-1535px */
@media (min-width: 1280px) and (max-width: 1535px) {
  .md\:px-10 {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
}

/* 2xl: 1536px+ */
@media (min-width: 1536px) {
  .md\:px-10 {
    padding-left: 5rem !important;
    padding-right: 5rem !important;
  }
}

/* ----------------------------------------------------------------
   27. SPECIFIC COMPONENT FIXES — index.html
   ---------------------------------------------------------------- */

/* Hero section — tighten on mobile */
@media (max-width: 767px) {
  header.relative {
    padding-top: 2rem !important;
    padding-bottom: 3rem !important;
  }
}

/* "About" section — text size */
@media (max-width: 480px) {
  #about h2 {
    font-size: clamp(1.5rem, 6vw, 2.5rem) !important;
  }
}

/* ----------------------------------------------------------------
   28. SPECIFIC COMPONENT FIXES — services.html
   ---------------------------------------------------------------- */

/* Service detail cards — equal height columns */
@media (min-width: 640px) and (max-width: 1023px) {
  .service-detail-card {
    min-height: 280px;
  }
}

/* Service stats — smaller on mobile */
@media (max-width: 480px) {
  .service-stat-num {
    font-size: 2rem !important;
  }
}

/* ----------------------------------------------------------------
   29. SPECIFIC COMPONENT FIXES — portfolio.html
   ---------------------------------------------------------------- */

/* Portfolio expertise blocks — 1 col on mobile */
@media (max-width: 639px) {
  .portfolio-expertise-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Portfolio expertise block image height */
@media (max-width: 480px) {
  .portfolio-expertise-block {
    height: 200px !important;
  }
}

/* ----------------------------------------------------------------
   30. SPECIFIC COMPONENT FIXES — contact.html
   ---------------------------------------------------------------- */

/* Contact form grid — single col on small mobile */
@media (max-width: 639px) {
  .contact-form-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Contact info boxes — better padding on mobile */
@media (max-width: 480px) {
  .contact-info-box {
    padding: 1rem !important;
  }
}
