/* =========================================================
   Global responsive fixes — all pages, all breakpoints
   ========================================================= */

/* Footer responsive polish */
.foot-cta-form {
  display: flex;
  gap: var(--space-2, 10px);
  flex-wrap: wrap;
  min-width: 0;
}

.foot-cta-form .input {
  flex: 1;
  min-width: 200px;
}

@media (max-width: 768px) {
  .foot-cta {
    flex-direction: column;
    gap: var(--space-4, 16px);
  }

  .foot-cta-form {
    width: 100%;
  }

  .foot-cta-form .input,
  .foot-cta-form .btn {
    width: 100%;
  }

  .footer-grid-upgraded {
    gap: var(--space-5, 24px);
  }
}

/* Product grid consistency */
.product-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

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

/* Shop layout overflow */
.shop-layout {
  min-width: 0;
}

.shop-filters .input,
.shop-filters select {
  width: 100%;
}

/* Prevent horizontal overflow */
main {
  overflow-x: clip;
  min-width: 0;
}

img, video, svg {
  max-width: 100%;
  height: auto;
}

/* Forms — touch-friendly on mobile */
.input,
.searchbar input,
select,
textarea {
  font-size: 16px; /* prevents iOS zoom on focus */
  min-height: 44px;
}

@media (min-width: 768px) {
  .input,
  .searchbar input {
    font-size: 14px;
    min-height: 40px;
  }
}

/* Buttons — minimum tap target */
.btn {
  min-height: 44px;
}

.btn.sm {
  min-height: 38px;
}

/* Grids */
.grid,
.product-grid,
.footer-grid-upgraded,
.sd-offers-grid {
  min-width: 0;
}

@media (max-width: 320px) {
  .sd-slide-actions {
    flex-direction: column;
  }

  .sd-slide-actions .btn {
    width: 100%;
  }

  .foot-cta-form {
    flex-direction: column;
  }

  .foot-cta-form .btn {
    width: 100%;
  }
}

@media (max-width: 375px) {
  .product-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .shop-layout {
    gap: var(--space-5);
  }
}

@media (min-width: 1440px) {
  .section {
    padding: 56px 0;
  }
}

@media (min-width: 1920px) {
  .sd-hero-track {
    height: clamp(480px, 32vw, 640px) !important;
    max-height: 640px;
  }
}

/* Toast messages */
.toast {
  word-break: break-word;
}

/* Account / auth pages */
.auth-card,
.checkout-card,
.cart-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Policy / content pages */
.page-content,
.policy-body {
  overflow-wrap: break-word;
}

.page-content img {
  border-radius: var(--radius-md);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
