/* ========================================
   RESPONSIVE - Mobile First Breakpoints
   Breakpoints: 320 · 480 · 768 · 1024 · 1280
   ======================================== */

/* ========================================
   GLOBAL TOUCH-FRIENDLY DEFAULTS
   Ensures minimum 44×44px tap targets (WCAG 2.5.5)
   ======================================== */
@media (pointer: coarse) {
  .btn,
  .navbar__link,
  .product-tabs__tab,
  .hero-ss__dot,
  .news-carousel__arrow,
  .footer__social-icon,
  .mobile-menu__link,
  .mobile-menu__sublink {
    min-height: 44px;
    min-width: 44px;
  }

  /* Increase link padding for fat-finger friendliness */
  .footer__link {
    padding: 0.375rem 0;
  }
}

/* ========================================
   TABLET & MEDIUM DEVICES (768px+)
   ======================================== */
@media (min-width: 768px) {
  :root {
    --vs-container-padding: clamp(1rem, 3vw, 2rem);
  }

  .show-mobile {
    display: none !important;
  }
}

/* ========================================
   DESKTOP & LARGE DEVICES (1024px+)
   ======================================== */
@media (min-width: 1024px) {
  :root {
    --vs-container-padding: clamp(1.5rem, 4vw, 2.5rem);
  }

  .show-tablet-down {
    display: none !important;
  }
}

/* ========================================
   EXTRA LARGE DEVICES (1280px+)
   ======================================== */
@media (min-width: 1280px) {
  :root {
    --vs-container-padding: clamp(2rem, 5vw, 3rem);
  }
}

/* ========================================
   MOBILE TYPOGRAPHY (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
  /* Prevent long words from causing horizontal overflow */
  body {
    font-size: 0.9375rem;
    overflow-wrap: break-word;
    word-break: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
  }

  h1 {
    font-size: clamp(2rem, 1.5rem + 3.5vw, 3rem);
  }

  h2 {
    font-size: clamp(1.5rem, 1.25rem + 2vw, 2.25rem);
  }

  h3 {
    font-size: clamp(1.25rem, 1.1rem + 1vw, 1.5rem);
  }

  .display-title {
    font-size: clamp(2.25rem, 1.5rem + 4vw, 3.5rem);
  }

  .display-subtitle {
    font-size: clamp(1rem, 0.9rem + 0.8vw, 1.25rem);
  }

  .section-title {
    font-size: clamp(1.5rem, 1.25rem + 1.5vw, 2rem);
  }

  .section-subtitle {
    margin-bottom: var(--vs-space-lg);
  }

  /* Prevent horizontal scroll from overflowing elements */
  .container {
    overflow-x: hidden;
  }
}

/* ========================================
   SMALL MOBILE (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
  h1 {
    font-size: clamp(1.75rem, 1.25rem + 3vw, 2.5rem);
  }

  h2 {
    font-size: clamp(1.25rem, 1rem + 1.5vw, 1.75rem);
  }

  .display-title {
    font-size: clamp(1.75rem, 1.25rem + 3vw, 2.5rem);
  }

  body {
    font-size: 0.875rem;
    line-height: 1.6;
  }
}

/* ========================================
   NAVBAR RESPONSIVE
   ======================================== */
@media (max-width: 825px) { /*gar 768 to 825 */
  .navbar {
    height: var(--vs-navbar-height);
  }

  .navbar__menu {
    display: none;
  }

  .navbar__hamburger {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .navbar__logo img {
    height: 28px;
  }

  .mega-dropdown {
    position: fixed;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    min-width: auto;
    width: 90vw;
    grid-template-columns: 1fr;
    margin: 0 5vw;
    opacity: 0;
    visibility: hidden;
  }

  .navbar__item:hover .mega-dropdown {
    opacity: 0;
    visibility: hidden;
  }

  /* Mobile menu — hidden by default, animated open/close */
  .mobile-menu {
    /* Keep display: none from components.css — only show when active */
    flex-direction: column;
  }

  .mobile-menu--active {
    display: flex;
    animation: mobileMenuIn 0.3s ease forwards;
  }

  @keyframes mobileMenuIn {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Bigger touch targets for mobile menu links */
  .mobile-menu__link {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu__sublink {
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
}

/* ========================================
   GRID RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

@media (max-width: 768px) {
  .grid--4,
  .grid--3,
  .grid--2 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: clamp(40px, 8vw, 80px) 0;
  }

  .section--lg {
    padding: clamp(60px, 10vw, 100px) 0;
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--vs-space-lg);
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: clamp(32px, 6vw, 60px) 0;
  }

  .section--lg {
    padding: clamp(40px, 8vw, 80px) 0;
  }
}

/* ========================================
   FOOTER RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .footer__bottom {
    flex-direction: column;
    gap: var(--vs-space-sm);
    text-align: center;
  }

  .footer {
    padding: 2rem 0 1rem;
  }

  .footer__grid {
    gap: var(--vs-space-lg);
  }

  /* Bigger social icons for touch */
  .footer__social-icon {
    width: 40px;
    height: 40px;
  }

  .footer__social {
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .footer {
    padding: 1.5rem 0 1rem;
    font-size: 0.8125rem;
  }

  .footer__grid {
    padding: 0 var(--vs-container-padding) var(--vs-space-md);
  }

  .footer__brand {
    padding-bottom: var(--vs-space-md);
    margin-bottom: var(--vs-space-md);
  }

  .footer__title {
    font-size: 0.7rem;
  }

  /* Center footer content on very small screens */
  .footer__grid {
    text-align: center;
  }

  .footer__social {
    justify-content: center;
  }
}

/* ========================================
   CONTACT GRID RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--vs-space-3xl);
  }

  .contact-info {
    gap: var(--vs-space-xl);
  }
}

/* ========================================
   STATS STRIP RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .stats-strip__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-strip__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--vs-space-lg);
  }

  .stats-strip {
    padding: clamp(32px, 4vw, 48px) var(--vs-container-padding);
  }

  .stats-strip__number {
    font-size: clamp(1.5rem, 1rem + 1.5vw, 2rem);
  }

  .stats-strip__suffix {
    font-size: clamp(1.25rem, 0.875rem + 1vw, 1.75rem);
  }
}

@media (max-width: 480px) {
  .stats-strip__grid {
    grid-template-columns: 1fr;
    gap: var(--vs-space-md);
  }

  .stats-strip__number {
    font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  }
}

/* ========================================
   BUTTONS RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  .btn--lg {
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
  }

  .btn--sm {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .cta-section__buttons,
  .product-hero__ctas,
  .hero__ctas,
  .form__actions {
    flex-direction: column;
    gap: var(--vs-space-md);
  }

  .cta-section__buttons .btn,
  .product-hero__ctas .btn,
  .hero__ctas .btn,
  .form__actions .btn {
    width: 100%;
  }
}

/* ========================================
   CARDS RESPONSIVE
   ======================================== */
@media (max-width: 650px) {
  .card {
    padding: var(--vs-space-lg);
  }

  /* Carousel cards: viewport-based width for peek-at-next effect */
  .news-carousel__track .news-card {
    min-width: 80vw;
    scroll-snap-align: center;
  }

  /* Prevent hover lift on touch — feels janky */
  .card:hover,
  .news-card:hover {
    transform: none;
  }
}

/* ========================================
   FORMS RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .form--grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .form--grid-2,
  .form--grid-3 {
    grid-template-columns: 1fr;
  }

  .form-newsletter {
    flex-direction: column;
  }

  .form-newsletter .form-input {
    margin-bottom: var(--vs-space-md);
  }

  .form-newsletter .btn {
    width: 100%;
  }

  .contact-form__field-group {
    grid-template-columns: 1fr;
  }

  .contact-form__actions {
    flex-direction: column;
  }

  .contact-form__actions .btn {
    width: 100%;
  }

  .form-input,
  .form-textarea,
  .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* ========================================
   NEWS CAROUSEL RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .news-carousel__header {
    flex-direction: column;
    gap: var(--vs-space-md);
    align-items: flex-start;
  }

  .news-carousel__arrows {
    /*display: none;*/
  }

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

  .news-card {
    min-width: 100%;
  }

  .news-carousel__track {
    gap: var(--vs-space-md);
  }
}

/* ========================================
   PRODUCT SECTIONS RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .product-features__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-overview__content {
    grid-template-columns: 1fr;
    gap: var(--vs-space-3xl);
  }

  .comparison-table__row {
    grid-template-columns: 1fr 1fr;
  }

  .product-gallery__grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .product-hero {
    padding: calc(var(--vs-navbar-height) + var(--vs-space-2xl)) 0 var(--vs-space-2xl);
  }

  .product-hero__title {
    font-size: clamp(1.75rem, 1.25rem + 3vw, 2.5rem);
  }

  .product-hero__desc {
    font-size: 0.9375rem;
  }

  /* Product tab bar — stack CTA below on narrow screens */
  .product-tabs__inner {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .product-tabs__tab--cta {
    margin-left: 0;
    margin-top: 0.25rem;
    flex: 1 1 100%;
    text-align: center;
    justify-content: center;
  }

  .product-features__grid {
    grid-template-columns: 1fr;
    gap: var(--vs-space-2xl);
  }

  .product-overview__visual {
    min-height: 300px;
  }

  .comparison-table__row {
    grid-template-columns: 1fr;
  }

  .comparison-table__header,
  .comparison-table__cell {
    text-align: left;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .product-gallery__grid {
    grid-template-columns: 1fr;
  }

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

  .product-cta__buttons,
  .product-hero__ctas {
    flex-direction: column;
  }

  .product-cta__buttons .btn,
  .product-hero__ctas .btn {
    width: 100%;
  }
}

/* ========================================
   DISPLAY UTILITIES RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .show-mobile {
    display: none !important;
  }

  .hide-desktop {
    display: none !important;
  }
}

/* ========================================
   PAGE HERO RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .page-hero {
    padding: calc(var(--vs-navbar-height) + var(--vs-space-2xl)) 0 var(--vs-space-2xl);
  }

  .page-hero h1 {
    margin-bottom: var(--vs-space-sm);
  }

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

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .navbar,
  .topbar,
  .footer,
  .news-carousel__arrows,
  .hero__controls,
  .hero__arrow,
  .mobile-menu,
  .btn--ghost {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
    font-size: 12pt;
    line-height: 1.5;
  }

  .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  a {
    text-decoration: underline;
  }

  .card,
  .news-card {
    break-inside: avoid;
    border: 1px solid #cccccc;
    box-shadow: none;
    page-break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }

  img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   EXTRA SMALL DEVICES (max-width: 320px)
   iPhone SE, Galaxy Fold, small screens
   ======================================== */
@media (max-width: 320px) {
  :root {
    --vs-container-padding: 0.75rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .display-title {
    font-size: 1.5rem;
  }

  body {
    font-size: 0.8125rem;
  }

  /* Product pages */
  .product-hero__title {
    font-size: 1.375rem;
  }

  .product-tabs__tab {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
  }

  /* Buttons */
  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }

  .btn--white,
  .btn--ghost-light {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  /* Cards */
  .news-card {
    min-width: 100%;
  }

  .news-card__body {
    padding: var(--vs-space-md);
  }

  .news-card__title {
    font-size: 0.9375rem;
  }

  /* Section spacing */
  .section {
    padding: clamp(24px, 5vw, 48px) 0;
  }

  .section--lg {
    padding: clamp(32px, 6vw, 64px) 0;
  }

  /* Mobile menu adjustments */
  .mobile-menu__link {
    font-size: 1rem;
  }

  .mobile-menu__sublink {
    font-size: 0.875rem;
  }

  /* Footer */
  .footer {
    padding: 1.25rem 0 0.75rem;
    font-size: 0.75rem;
  }

  .footer__social-icon {
    width: 36px;
    height: 36px;
  }

  /* Stats strip */
  .stats-strip__number {
    font-size: 1rem;
  }

  .stats-strip__label {
    font-size: 0.625rem;
  }
}

/* ========================================
   SAFE AREA INSETS (iPhone notch, etc.)
   ======================================== */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer__bottom {
    padding-bottom: calc(var(--vs-space-md) + env(safe-area-inset-bottom));
  }

  .mobile-menu {
    padding-bottom: calc(var(--vs-space-md) + env(safe-area-inset-bottom));
  }

  .navbar {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* ========================================
   HIGH DPI / RETINA DISPLAYS
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: subpixel-antialiased;
  }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */
@media (max-height: 320px) and (orientation: landscape) {
  .navbar {
    height: 44px;
  }

    /* Copied to hero-slideshow.css
 .hero-ss {
    min-height: auto;
    height: auto;
  }

  .hero-ss__inner {
    padding-top: calc(44px + 1rem);
    padding-bottom: 3rem;
  }

  .hero-ss__visual {
    max-width: 180px;
  }*/

  .section {
    padding: var(--vs-space-xl) 0;
  }

  .display-title {
    font-size: clamp(1.5rem, 1rem + 2vw, 2rem);
  }

  .product-hero {
    padding: calc(44px + var(--vs-space-xl)) 0 var(--vs-space-xl);
  }

  .mobile-menu {
    top: 44px;
    max-height: calc(100vh - 44px);
    padding-top: var(--vs-space-xs);
  }
}

/* ========================================
   HOVER-CAPABLE DEVICES ONLY
   Disable hover effects on touch devices
   ======================================== */
@media (hover: none) {
  .news-card:hover {
    transform: none;
    box-shadow: none;
  }

  .btn--primary:hover {
    transform: none;
  }

  .product-card:hover {
    transform: none;
  }

  .product-card:hover .product-card__cta {
    gap: 0.5rem;
  }

  .footer__social-icon:hover {
    transform: none;
  }
}

/* ========================================
   ORIENTATION CHANGE — Prevent text scaling
   ======================================== */
@media (max-width: 1024px) {
  html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}
