/* ============================================
   SUMAN PHOTO STUDIO — RESPONSIVE OVERRIDES
   Full-spectrum: Mobile → Tablet → Laptop → Desktop
   ============================================ */

/* ==============================
   GLOBAL SAFE DEFAULTS
   ============================== */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }

/* ==============================
   DESKTOP — ≥1400px
   ============================== */
@media (min-width: 1400px) {
  .container { max-width: 1360px; }
  .container-wide { max-width: 1680px; }
  .hero-title { font-size: 7rem; }
}

/* ==============================
   LARGE LAPTOP — 1200px–1399px
   ============================== */
@media (max-width: 1399px) {
  .container, .container-wide { padding: 0 40px; }
  #navbar { padding: 0 40px; }
  .nav-links { gap: 28px; }
  .footer-grid { grid-template-columns: 1.8fr 1fr 1fr 1.4fr; gap: 48px; }
}

/* ==============================
   LAPTOP / LARGE TABLET — 992px–1199px
   ============================== */
@media (max-width: 1199px) {
  :root { --nav-height: 72px; }
  .container, .container-wide { padding: 0 32px; }
  #navbar { padding: 0 32px; }
  .nav-links { gap: 22px; }
  .nav-link { font-size: 0.75rem; }

  /* Grids */
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }

  /* Instagram */
  .instagram-grid { grid-template-columns: repeat(4, 1fr); }

  /* About */
  .about-grid { gap: 48px; }
  .about-image-accent { width: 50%; right: -20px; bottom: -20px; }

  /* Hero */
  .hero-content { padding: 0 6% 80px; }
  .hero-stat-number { font-size: 1.6rem; }
}

/* ==============================
   TABLET — 768px–991px
   ============================== */
@media (max-width: 991px) {
  :root { --nav-height: 68px; }
  .container, .container-wide { padding: 0 24px; }
  #navbar { padding: 0 24px; }
  .section { padding: 80px 0; }
  .section-sm { padding: 60px 0; }
  .section-header { margin-bottom: 48px; }

  /* Nav — hide links, show hamburger */
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }

  /* Hero */
  .hero-content {
    padding: 0 5% 60px;
    align-items: flex-start;
    justify-content: flex-end;
    padding-bottom: 80px;
  }
  .hero-title { font-size: clamp(2.5rem, 6vw, 4.5rem); max-width: 100%; }
  .hero-subtitle { font-size: 1rem; max-width: 440px; }
  .hero-actions { gap: 14px; }
  .hero-arrow { display: none; }
  .hero-controls { right: 20px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }
  .hero-stat { padding: 0 20px 0 0; }
  .hero-stat-sep { height: 30px; margin: 0 20px 0 0; }

  /* Masonry Grid (CSS Grid implementation for consistency and responsiveness) */
  .masonry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .masonry-item { margin-bottom: 0; }

  /* About */
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-image-wrapper { max-width: 480px; margin: 0 auto; }
  .about-image-accent { right: -12px; bottom: -12px; width: 50%; }
  .about-badge { left: -8px; }

  /* Services */
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* Films */
  .films-grid { grid-template-columns: 1fr; gap: 20px; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }

  /* Pricing */
  .pricing-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .pricing-card.popular { transform: scale(1); }

  /* Blog */
  .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* Form grid */
  .form-grid { grid-template-columns: 1fr 1fr; }

  /* Instagram */
  .instagram-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* Team */
  .team-grid { grid-template-columns: repeat(2, 1fr); }

  /* Achievements */
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }

  /* Testimonial */
  .testimonial-card { padding: 0 40px; }

  /* Page header */
  .page-header { height: 45vh; min-height: 320px; }

  /* Inline grid overrides (pricing.php other-services) */
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ==============================
   MOBILE LARGE — 600px–767px
   ============================== */
@media (max-width: 767px) {
  :root { --nav-height: 64px; }
  .container, .container-wide { padding: 0 20px; }
  #navbar { padding: 0 20px; }
  .section { padding: 64px 0; }
  .section-header { margin-bottom: 40px; }
  .section-title { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .section-subtitle { font-size: 0.95rem; }

  /* Hero */
  .hero-content {
    padding: 0 20px 60px;
    align-items: flex-start;
    justify-content: center;
  }
  .hero-title { font-size: clamp(2rem, 8vw, 3.5rem); }
  .hero-subtitle { font-size: 0.95rem; max-width: 100%; }
  .hero-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; padding-top: 24px; }
  .hero-stat { padding: 0 16px 0 0; }
  .hero-stat-sep { height: 28px; margin: 0 16px 0 0; }
  .hero-scroll { display: none; }
  .hero-controls { display: none; }
  .hero-arrow { display: none; }
  .hero-eyebrow { margin-bottom: 16px; }

  /* Nav */
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }

  /* Masonry Grid (CSS Grid implementation for mobile) */
  .masonry-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

  /* Services */
  .services-grid { grid-template-columns: 1fr; }
  .service-card-body { padding: 22px; }

  /* Films */
  .films-grid { grid-template-columns: 1fr; gap: 16px; }
  .film-card { aspect-ratio: 16/10; }

  /* About */
  .about-stats { grid-template-columns: 1fr 1fr; }
  .about-image-accent { right: -8px; bottom: -8px; width: 48%; }
  .about-badge { left: -4px; }

  /* Testimonials */
  .testimonial-card { padding: 0 16px; }
  .testimonial-quote { font-size: clamp(1rem, 3.5vw, 1.3rem); }
  .testimonials-nav { margin-top: 32px; }

  /* Instagram */
  .instagram-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }

  /* Pricing */
  .pricing-grid { grid-template-columns: 1fr; max-width: 100%; }
  .pricing-card { padding: 32px 24px; }
  .pricing-card.popular { transform: scale(1); }

  /* Blog */
  .blog-grid { grid-template-columns: 1fr; }

  /* Form */
  .form-grid { grid-template-columns: 1fr; }
  .contact-grid { gap: 40px; }

  /* Contact form wrapper padding fix (inline style override) */
  .contact-form-wrap,
  div[style*="padding:40px"],
  div[style*="padding: 40px"] {
    padding: 24px !important;
    border-radius: 16px !important;
  }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-desc { max-width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 12px; }
  .footer-social { flex-wrap: wrap; }

  /* Team */
  .team-grid { grid-template-columns: 1fr 1fr; }

  /* Achievements */
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }

  /* CTA */
  #cta { padding: 80px 0; }
  .cta-actions { flex-direction: column; align-items: center; }
  .cta-actions .btn { width: 100%; max-width: 320px; justify-content: center; }

  /* Page header */
  .page-header { height: 42vh; min-height: 300px; }
  .page-header-content { padding-top: calc(var(--nav-height) + 16px); }
  .page-header-title { font-size: clamp(2rem, 8vw, 3.5rem); }

  /* Buttons */
  .btn { padding: 14px 28px; font-size: 0.78rem; }

  /* Inline grid overrides (pricing.php other-services) */
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Fullmenu */
  .fullmenu-link { font-size: clamp(1.8rem, 8vw, 3rem); }
  .fullmenu-inner { gap: 24px; }
  .fullmenu-contact { gap: 12px; }

  /* Lightbox */
  .lightbox-img { max-width: 96vw; max-height: 80vh; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }

  /* Map */
  .map-embed { aspect-ratio: 4/3; }
}

/* ==============================
   MOBILE — 480px–599px
   ============================== */
@media (max-width: 599px) {
  :root { --nav-height: 60px; }
  .container, .container-wide { padding: 0 16px; }
  #navbar { padding: 0 16px; }
  .section { padding: 52px 0; }
  .section-header { margin-bottom: 32px; }

  /* Logo */
  .nav-logo-main { font-size: 1.25rem; }
  .nav-logo-sub { font-size: 0.55rem; }

  /* Hero */
  .hero-title { font-size: clamp(1.9rem, 9vw, 3rem); }
  .hero-subtitle { font-size: 0.9rem; }
  .hero-actions { flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }
  .hero-actions .btn { width: 100%; justify-content: center; text-align: center; }
  .hero-stat-number { font-size: 1.4rem; }
  .hero-stats { gap: 12px; }

  /* Section title */
  .section-title { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .cta-title { font-size: clamp(2rem, 7vw, 3.5rem); }

  /* About */
  .about-stats { grid-template-columns: 1fr 1fr; gap: 16px; }
  .about-stat { padding: 20px 16px; }
  .about-stat-number { font-size: 2rem; }
  .about-badge { padding: 14px; left: -4px; }
  .about-badge-number { font-size: 1.8rem; }

  /* Filter buttons */
  .portfolio-filters { gap: 8px; }
  .filter-btn { padding: 8px 14px; font-size: 0.7rem; }

  /* Services */
  .service-card-body { padding: 18px; }
  .service-card-title { font-size: 1.1rem; }

  /* Pricing */
  .pricing-card { padding: 28px 18px; }
  .pricing-price { font-size: 2.4rem; }

  /* Testimonials */
  .testimonial-card { padding: 0 8px; }
  .testimonials-btn { width: 40px; height: 40px; }

  /* Instagram */
  .instagram-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }

  /* Instagram on very small */
  .instagram-item { border-radius: 6px; }

  /* Achievements */
  .achievements-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .achievement-card { padding: 24px 16px; }
  .achievement-number { font-size: 2.4rem; }

  /* Team */
  .team-grid { grid-template-columns: 1fr 1fr; }

  /* WhatsApp */
  #whatsapp-float { bottom: 20px; right: 20px; width: 50px; height: 50px; }
  #whatsapp-float svg { width: 24px; height: 24px; }

  /* Page header */
  .page-header { height: 40vh; min-height: 280px; }
  .page-header-title { font-size: clamp(1.8rem, 8vw, 2.8rem); }

  /* Lightbox */
  .lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; }

  /* Map */
  .map-embed { aspect-ratio: 1/1; }

  /* Contact card */
  .contact-card { padding: 20px 16px; gap: 14px; }
  .contact-card-icon { width: 44px; height: 44px; flex-shrink: 0; }

  /* Buttons full-width in hero and CTA */
  .btn { padding: 13px 24px; }

  /* Hero eyebrow */
  .hero-eyebrow-line { width: 24px; }
  .hero-eyebrow-text { font-size: 0.65rem; }

  /* Footer */
  .footer-logo-main { font-size: 1.5rem; }
  .footer-col-title { font-size: 0.95rem; margin-bottom: 16px; }
}

/* ==============================
   MOBILE SMALL — <480px
   ============================== */
@media (max-width: 479px) {
  :root { --nav-height: 58px; }
  .container, .container-wide { padding: 0 14px; }
  #navbar { padding: 0 14px; }

  /* Logo shrink */
  .nav-logo-main { font-size: 1.15rem; }

  /* Hero */
  .hero-title { font-size: clamp(1.75rem, 9vw, 2.5rem); }
  .hero-actions .btn { padding: 12px 20px; font-size: 0.75rem; }

  /* Team */
  .team-grid { grid-template-columns: 1fr; }
  .team-card img { aspect-ratio: 4/3; }

  /* About */
  .about-image-accent { display: none; }
  .about-badge { left: 0; top: 16px; }

  /* Stats */
  .hero-stats { gap: 8px; }
  .hero-stat { padding: 0 12px 0 0; }
  .hero-stat-sep { height: 24px; margin: 0 12px 0 0; }
  .hero-stat-number { font-size: 1.3rem; }

  /* Section */
  .section { padding: 44px 0; }

  /* Pricing */
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-price { font-size: 2.2rem; }

  /* Instagram */
  .instagram-grid { grid-template-columns: repeat(2, 1fr); }

  /* Map */
  .map-embed { aspect-ratio: 4/3; }
}

/* ==============================
   EXTRA SMALL — <360px
   ============================== */
@media (max-width: 359px) {
  .container, .container-wide { padding: 0 12px; }
  #navbar { padding: 0 12px; }
  .nav-logo-main { font-size: 1rem; }
  .hero-title { font-size: 1.7rem; }
  .hero-actions .btn { padding: 11px 16px; font-size: 0.72rem; }
  .section-title { font-size: 1.5rem; }
  .filter-btn { padding: 7px 12px; font-size: 0.68rem; }
  .instagram-grid { grid-template-columns: repeat(2, 1fr); gap: 3px; }
  .about-stats { grid-template-columns: 1fr; }
  .achievements-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 8px; }
}

/* ==============================
   TOUCH DEVICE IMPROVEMENTS
   ============================== */
@media (hover: none) and (pointer: coarse) {
  /* Always show overlays on touch */
  .masonry-overlay { opacity: 1; }
  .masonry-zoom { opacity: 1; }
  .masonry-info { transform: translateY(0); }

  /* Remove hover transforms that don't work on touch */
  .service-card:hover { transform: none; }
  .about-stat:hover { transform: none; }
  .blog-card:hover { transform: none; }
  .achievement-card:hover { transform: none; }
  .contact-card:hover { transform: none; }
  .pricing-card:hover:not(.popular) { transform: none; }
  .footer-social-link:hover { transform: none; }

  /* Bigger tap targets */
  .nav-link, .footer-link { padding: 4px 0; }
  .filter-btn { min-height: 44px; }
  .hamburger { padding: 8px; }
  .lightbox-nav, .lightbox-close, .testimonials-btn { min-width: 44px; min-height: 44px; }
  #whatsapp-float { min-width: 52px; min-height: 52px; }
  .hero-dot { width: 10px; height: 10px; }
  .btn { min-height: 48px; }
  .form-input, .form-textarea, .form-select { font-size: 16px; } /* Prevent iOS zoom */
}

/* ==============================
   ADMIN PANEL RESPONSIVE
   ============================== */
@media (max-width: 991px) {
  .admin-layout { flex-direction: column; }
  .sidebar {
    width: 100% !important;
    height: auto !important;
    position: relative !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    padding: 12px 16px !important;
    gap: 8px;
  }
  .sidebar-logo {
    font-size: 1.1rem !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto;
    align-self: center;
  }
  .sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    padding: 0 !important;
    gap: 4px;
    flex: 1;
  }
  .sidebar-nav li a {
    padding: 8px 12px !important;
    border-left: none !important;
    border-bottom: 2px solid transparent !important;
    font-size: 0.8rem !important;
    white-space: nowrap;
  }
  .sidebar-nav li a.active {
    border-left-color: transparent !important;
    border-bottom-color: var(--accent) !important;
  }
  .main-content { padding: 20px !important; }
  .header h1 { font-size: 1.5rem !important; }
}

@media (max-width: 600px) {
  .sidebar {
    flex-direction: column !important;
    padding: 12px !important;
  }
  .sidebar-nav {
    flex-direction: column !important;
    width: 100%;
  }
  .sidebar-nav li a { padding: 10px 12px !important; }
  .main-content { padding: 16px !important; }

  /* Admin stat grid */
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .admin-form-grid { grid-template-columns: 1fr !important; }

  /* Admin table scrollable */
  .admin-table-wrap { overflow-x: auto; }
  .admin-table { min-width: 600px; }
  table { min-width: 480px; }
}

/* ==============================
   OVERFLOW / SCROLL PREVENTION
   ============================== */
/* Prevent any element wider than viewport */
section, article, aside, main, header, footer, nav,
.container, .container-wide,
.hero-content, .hero-stats,
.about-grid, .services-grid, .films-grid, .footer-grid,
.pricing-grid, .blog-grid, .testimonials-track,
.instagram-grid, .masonry-grid {
  max-width: 100%;
}

/* Ensure images never overflow their containers */
img, video, iframe {
  max-width: 100%;
}

/* ==============================
   TYPOGRAPHY — FLUID SCALING
   ============================== */
/* Prevent text overflow */
h1, h2, h3, h4, h5, h6 {
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

p, li, a, span {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ==============================
   PRINT (basic)
   ============================== */
@media print {
  #navbar, #whatsapp-float, #fullscreen-menu,
  .hero-controls, .hero-arrow, .hero-scroll,
  .lightbox, #video-popup { display: none !important; }
  body { color: #000; background: #fff; }
  .container { max-width: 100%; padding: 0 16px; }
}
