/* SARAIL MARKET - device responsive layer v1.0
   Loaded last on active storefront pages. Keeps desktop styling intact. */
:root { --sm-device-gutter: clamp(12px, 2.4vw, 28px); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-width: 320px; overflow-x: hidden; }
img, video, iframe, svg { max-width: 100%; }
img { height: auto; }
.container, main, section, article, aside, header, footer,
.inner-content, .section, .page-content, .content { min-width: 0; }
button, input, select, textarea { max-width: 100%; }
input, select, textarea { font-size: 16px; } /* prevents iOS focus zoom */
button, .button, .btn, a.button, a.btn { touch-action: manipulation; }
.table-wrap, .table-responsive, .orders-table-wrap, .table-container {
  max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
pre, code { max-width: 100%; overflow-x: auto; }
iframe { width: 100%; }
@media (max-width: 1024px) {
  .container { width: calc(100% - 36px); max-width: 100%; }
  .header-main { gap: 14px; }
  .search-box { max-width: 360px; }
  .nav-inner { flex-wrap: wrap; justify-content: center; }
  .hero, .hero-section, .banner { max-width: calc(100% - 28px); }
  .hero h1, .banner h1 { font-size: clamp(25px, 4vw, 38px); }
  .product-detail-layout, .cart-page-layout { gap: 20px; }
  .sidebar, .shop-sidebar { min-width: 0; }
}
@media (max-width: 768px) {
  html { scroll-padding-top: 88px; }
  .container { width: calc(100% - 28px) !important; }
  .announcement { min-height: 30px; padding: 6px 10px; font-size: 10px; line-height: 1.7; text-align: center; }
  .site-header { position: sticky; top: 0; width: 100%; max-width: 100%; border-radius: 0 0 14px 14px; }
  .header-main { min-height: 62px; padding: 8px 12px !important; gap: 9px; flex-wrap: wrap; }
  .brand { gap: 6px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-type strong { font-size: 17px !important; letter-spacing: 1.5px !important; }
  .brand-type small { font-size: 8px !important; letter-spacing: 3px !important; }
  .header-actions { gap: 6px; margin-inline-start: auto; }
  .icon-button, .menu-toggle { width: 38px; height: 38px; min-width: 38px; }
  .search-box { order: 3; flex: 1 0 100%; width: 100%; max-width: none; height: 40px; margin: 2px 0 0; }
  .nav-wrap { max-width: 100%; }
  .nav-inner { display: flex; flex-wrap: nowrap !important; justify-content: flex-start; gap: 5px !important; padding: 7px 10px !important; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .nav-link { flex: 0 0 auto; min-height: 40px; padding: 8px 11px !important; white-space: nowrap !important; font-size: 12px; }
  .hero, .hero-section, .banner { width: calc(100% - 24px) !important; max-width: none; margin-inline: auto !important; padding: 24px 18px !important; }
  .hero h1, .banner h1 { font-size: clamp(24px, 5.5vw, 34px); line-height: 1.65; }
  .hero-copy, .hero-art, .hero-content, .hero-visual { width: 100%; min-width: 0; }
  .hero, .hero-section { display: flex; flex-direction: column; }
  .category-grid, .info-grid, .stats-grid, .form-grid, .footer-main,
  .product-detail-layout, .cart-page-layout { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .product-grid, #shopGrid, #productGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 16px !important; }
  .product-card, .category-card, .product-info, .product-image { min-width: 0; }
  .product-card { height: auto !important; }
  .product-image { min-height: 0; }
  .product-image img, .product-card img { max-width: 100%; }
  .shop-layout, .shop-page-layout, .catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) !important; gap: 16px; }
  .shop-sidebar, .sidebar, .filters-panel { width: 100%; max-width: 100%; position: static; }
  .shop-toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px !important; }
  .shop-toolbar input, .shop-toolbar select, .shop-toolbar .search-box { flex: 1 1 180px; width: 100%; min-width: 0; }
  .product-detail-layout, .cart-page-layout { padding: 14px !important; }
  .product-detail-art { min-height: 180px; }
  .form-row, .form-group, .field, .form-actions { min-width: 0; }
  input, select, textarea { width: 100%; min-width: 0; }
  .button, .btn, .page-cta { min-height: 44px; }
  .footer-main { gap: 20px; }
  .footer-bottom { flex-wrap: wrap; gap: 8px; text-align: center; }
  .modal, .dialog, .popup, .toast { max-width: calc(100vw - 24px); }
}
@media (max-width: 520px) {
  html { scroll-padding-top: 78px; }
  .container { width: calc(100% - 22px) !important; }
  .announcement { font-size: 9px; }
  .header-main { padding-inline: 9px !important; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-type strong { font-size: 15px !important; }
  .brand-type small { font-size: 7px !important; letter-spacing: 2px !important; }
  .header-actions { gap: 4px; }
  .icon-button, .menu-toggle { width: 35px; height: 35px; min-width: 35px; border-radius: 10px; }
  .hero, .hero-section, .banner { padding: 20px 14px !important; border-radius: 16px !important; }
  .hero h1, .banner h1 { font-size: 24px; }
  .category-grid, .info-grid, .stats-grid, .form-grid, .footer-main,
  .product-detail-layout, .cart-page-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .product-grid, #shopGrid, #productGrid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px !important; }
  .category-visual { max-height: 180px; }
  .product-image { min-height: 0 !important; }
  .product-image img { max-height: 240px; object-fit: contain; }
  .product-info { padding: 14px !important; }
  .product-info h3 { font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
  .product-meta { flex-wrap: wrap; gap: 8px; }
  .button, .btn, .page-cta, .add-cart { width: 100%; justify-content: center; white-space: normal; }
  .cart-page-item { grid-template-columns: minmax(0, 1fr) auto !important; }
  .footer-main { gap: 18px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  h1 { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
