/* Merlina Product — global responsive enhancements */

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

/* Prevent horizontal overflow */
body {
  overflow-x: hidden;
}

/* Fluid containers */
.container {
  width: 100%;
  padding-left: clamp(1rem, 4vw, 2rem);
  padding-right: clamp(1rem, 4vw, 2rem);
}

/* Header layout — stack gracefully on small screens */
@media (max-width: 1100px) {
  .main-header .header-inner {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center;
    gap: 12px;
  }
  .main-header .header-main-nav { display: none !important; }
  .main-header .header-right {
    justify-content: flex-end;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .utility-bar .container {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 6px;
    font-size: 0.7rem;
  }
  .logo a { font-size: 1rem !important; }
}

/* Footer */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 4vw, 40px);
}

@media (max-width: 992px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
}

@media (max-width: 576px) {
  .footer-grid { grid-template-columns: 1fr; }
  footer .newsletter-inline-form {
    flex-direction: column;
  }
  footer .newsletter-inline-form input,
  footer .newsletter-inline-form button {
    border-radius: var(--radius-pill) !important;
    width: 100%;
  }
  footer .newsletter-inline-form input { border-right: 1px solid var(--border) !important; margin-bottom: 8px; }
}

/* Shop page */
@media (max-width: 991px) {
  .shop-layout { flex-direction: column !important; }
  .shop-sidebar { width: 100% !important; }
  .products-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .shop-hero-banner { padding: 32px 24px !important; }
}

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

/* Cart & checkout */
@media (max-width: 900px) {
  .cart-grid-responsive { grid-template-columns: 1fr !important; }
  .cart-item { flex-direction: column !important; align-items: flex-start !important; }
  .cart-item > div:first-child { width: 100% !important; max-width: 140px; }
}

/* Product detail */
@media (max-width: 900px) {
  .product-detail-grid { grid-template-columns: 1fr !important; }
  .gallery-wrapper { flex-direction: column-reverse !important; }
  .gallery-wrapper .thumbnails {
    flex-direction: row !important;
    width: 100% !important;
    overflow-x: auto;
    gap: 10px !important;
  }
}

/* Blog grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
}

@media (max-width: 992px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 576px) {
  .blog-grid { grid-template-columns: 1fr !important; }
  .blog-filters { flex-wrap: wrap; gap: 12px !important; justify-content: flex-start !important; }
}

/* Content pages */
.page-content-card {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 576px) {
  .page-content-main { padding: 32px 0 60px; }
  .page-content-card { padding: 24px 18px !important; border-radius: var(--radius) !important; }
}

/* About page */
@media (max-width: 992px) {
  .ab-precision, .ab-footprint-grid { grid-template-columns: 1fr !important; }
  .ab-timeline { grid-template-columns: repeat(2, 1fr) !important; }
  .ab-years { right: 12px !important; bottom: 12px !important; }
}

@media (max-width: 560px) {
  .ab-timeline { grid-template-columns: 1fr !important; }
  .ab-hero-inner { padding: 60px 0 70px !important; }
}

/* Contact page */
@media (max-width: 992px) {
  .ct-grid { grid-template-columns: 1fr !important; }
  .ct-form-row { grid-template-columns: 1fr !important; }
}

/* Home — Merlina sections */
@media (max-width: 992px) {
  .tm-hero { padding: 40px 0 56px; }
  .tm-hero-grid { grid-template-columns: 1fr !important; gap: 32px; }
  .tm-hero-visual { order: -1; }
  .tm-brands-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .tm-features-grid { grid-template-columns: 1fr !important; gap: 28px; }
  .tm-promise-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .tm-sec-head { flex-direction: column; align-items: flex-start !important; }
}

@media (max-width: 576px) {
  .tm-brands-grid { grid-template-columns: 1fr !important; }
  .tm-hero-btns { flex-direction: column; width: 100%; }
  .tm-hero-btns a { text-align: center; width: 100%; }
  .tm-hero-badge { left: 12px !important; right: 12px; font-size: 0.75rem; }
  .tm-newsletter-form { flex-direction: column; max-width: 100% !important; padding: 0 8px; }
  .tm-newsletter-form input,
  .tm-newsletter-form button {
    border-radius: var(--radius-pill) !important;
    width: 100%;
  }
  .tm-newsletter-form button { margin-top: 8px; }
  .tm-section { padding: 48px 0; }
}

/* Tables scroll on mobile */
@media (max-width: 600px) {
  .specs-table, table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  .header-icon-link,
  .tm-prod-cart,
  .sp-btn,
  .btn,
  .mobile-bottom-nav a {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Swiper slides equal height */
.swiper-slide { height: auto; }
