/* ============================================
   RESPONSIVE STYLES — CAPERSMED
   Mobile-first fixes for all breakpoints
   ============================================ */

/* ===== GLOBAL OVERFLOW FIX ===== */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ===== MOBILE: < 768px ===== */
@media screen and (max-width: 767px) {

  /* --- Hero --- */
  .hero {
    height: 100vh;
    min-height: 500px;
    padding: 100px 1.5rem 3rem;
    background-attachment: scroll; /* fix iOS parallax bug */
  }

  .hero-content {
    margin-top: 2rem;
  }

  .hero-content h1 {
    font-size: 2rem;
    line-height: 1.15;
    margin-bottom: 1rem;
  }

  .hero-content p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }

  /* --- Sections --- */
  .section-padding {
    padding: 3.5rem 1.2rem;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* --- About Preview --- */
  .about-preview {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-text h2 {
    font-size: 1.8rem;
    text-align: center;
  }

  .about-text p {
    text-align: center;
    font-size: 1rem;
  }

  .caper-glow-wrap {
    min-height: 250px;
  }

  .caper-glow-wrap img {
    max-height: 280px;
  }

  /* --- Product Grid --- */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0;
  }

  .product-card {
    border-radius: 16px;
  }

  .product-img-wrapper {
    height: 200px;
  }

  .product-badge {
    font-size: 0.6rem;
    padding: 3px 10px;
    top: 0.75rem;
    right: 0.75rem;
  }

  .product-info {
    padding: 1.2rem 1rem 1.4rem;
  }

  .product-title {
    font-size: 1.25rem;
  }

  .product-short-desc {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  .product-footer {
    padding-top: 0.8rem;
  }

  .view-details-btn {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
  }

  /* --- Features Grid --- */
  .features-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .feature-box {
    padding: 1.5rem 1rem;
  }

  .feature-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
  }

  .feature-box h3 {
    font-size: 0.95rem;
  }

  /* --- Services Grid --- */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .service-card {
    padding: 2rem 1.5rem;
  }

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

  .contact-info {
    padding: 2rem 1.5rem;
    border-radius: 16px;
  }

  /* --- Footer --- */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-col h3::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-contact-item {
    justify-content: center;
  }

  .footer-bottom {
    font-size: 0.75rem;
  }

  /* --- WhatsApp Float --- */
  .whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 16px;
  }

  .whatsapp-float svg {
    width: 26px;
    height: 26px;
  }

  /* --- Products Table Page --- */
  .products-page-hero {
    padding: 110px 1.2rem 50px;
  }

  .products-page-hero h1 {
    font-size: 2rem;
  }

  .products-page-hero p {
    font-size: 0.95rem;
  }

  .products-table-section {
    padding: 2rem 1.2rem 3rem;
  }

  .products-table thead {
    display: none;
  }

  .products-table,
  .products-table tbody,
  .products-table tr,
  .products-table td {
    display: block;
    width: 100%;
  }

  .products-table tr {
    margin-bottom: 1.2rem;
    border: 1px solid #e0ede3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    background: #fff;
  }

  .products-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f0f5f1;
  }

  .products-table td:last-child {
    border-bottom: none;
  }

  .prod-img-cell {
    width: 100%;
  }

  .prod-img-wrap {
    width: 100px;
    height: 100px;
    margin: 0 auto;
  }

  .category-heading {
    font-size: 1.2rem;
  }

  /* --- Quick Nav --- */
  .product-quick-nav {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 0.5rem;
    margin-bottom: 1.5rem;
  }

  .product-quick-nav a {
    font-size: 0.72rem;
    padding: 6px 12px;
  }

  /* --- Product Detail Page --- */
  .pd-split-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .pd-inner-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.8rem !important;
  }

  .pd-cert-full {
    grid-column: span 2 !important;
  }

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

  /* --- CTA Buttons --- */
  .cta-buttons {
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
  }

  .cta-buttons .btn {
    width: 100%;
    max-width: 280px;
  }

  /* --- Alerts --- */
  .alert {
    margin: 0.5rem;
    font-size: 0.9rem;
  }

  /* --- Demo Banner padding --- */
  .demo-banner + main,
  body.anti-select main {
    padding-bottom: 40px;
  }
}

/* ===== TABLET: 768px — 1024px ===== */
@media screen and (min-width: 768px) and (max-width: 1024px) {

  .hero {
    height: 100vh;
    min-height: 600px;
    background-attachment: scroll;
  }

  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-content p {
    font-size: 1.1rem;
  }

  .section-padding {
    padding: 5rem 2rem;
  }

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

  .about-preview {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

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

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

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

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .whatsapp-float {
    width: 55px;
    height: 55px;
    bottom: 25px;
    right: 25px;
  }
}

/* ===== LARGE DESKTOP: > 1400px ===== */
@media screen and (min-width: 1400px) {
  .hero-content h1 {
    font-size: 5rem;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== iOS Safari parallax fix ===== */
@supports (-webkit-touch-callout: none) {
  .hero,
  .products-page-hero,
  .about-hero,
  .contact-hero,
  .blog-hero,
  .certs-hero,
  .services-hero,
  .branding-hero {
    background-attachment: scroll;
  }
}
