/* Mobile refinements for storefront and admin. Loaded after store.css. */
@media (max-width: 1024px) {
  .site-header { gap: 16px; }
  .header-actions { gap: 12px; }
  .shop-layout { gap: 22px; }
  .admin-panels { gap: 16px; }
}
@media (max-width: 750px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .top-strip { padding: 8px 12px; line-height: 1.4; }
  .site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 12px 16px; gap: 12px; }
  .logo { min-width: 0; font-size: 18px; line-height: 1.1; white-space: normal; }
  .logo-mark { flex: 0 0 38px; }
  .logo small { font-size: 9px; letter-spacing: .1em; line-height: 1.3; }
  .header-actions { margin: 0; gap: 4px; }
  .header-actions a { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
  .header-actions>a:first-child { font-size: 12px; line-height: 1.15; text-align: center; padding: 0 4px; }
  .header-actions>a:nth-child(2) { font-size: 26px; }
  .cart-link { white-space: nowrap; }
  .search { grid-column: 1 / -1; grid-row: 2; order: initial; width: 100%; max-width: none; margin: 0; }
  .search input { min-height: 47px; font-size: 16px; }
  .search button { width: 50px; min-height: 47px; }
  .category-nav { padding: 10px 16px; gap: 8px; scrollbar-width: none; }
  .category-nav::-webkit-scrollbar, .filter-panel::-webkit-scrollbar, .admin-nav::-webkit-scrollbar { display: none; }
  .category-nav a { background: #fff5e9; border: 1px solid #f0dfcb; padding: 9px 12px; border-radius: 20px; flex: 0 0 auto; font-size: 13px; }
  .hero { padding: 45px 20px 48px; min-height: 315px; }
  .hero h1 { font-size: clamp(37px, 9vw, 55px); margin: 15px 0; }
  .hero p { font-size: 16px; line-height: 1.55; }
  .hero .button { margin-top: 8px; }
  .container { min-width: 0; padding: 30px 16px; }
  .section-heading { gap: 15px; align-items: end; }
  .section-heading h2 { font-size: 26px; }
  .section-heading>a { text-align: right; line-height: 1.3; }
  .category-grid { gap: 10px; margin-bottom: 40px; }
  .category-grid a { min-height: 128px; padding: 18px 10px; }
  .products { gap: 10px; }
  .product-card { min-width: 0; }
  .product-body { padding: 12px; }
  .product-title { font-size: 14px; line-height: 1.4; min-height: 39px; }
  .product-category { font-size: 11px; }
  .price { min-height: 26px; flex-wrap: wrap; gap: 4px 8px; }
  .price strong { font-size: 17px; }
  .price del { font-size: 12px; }
  .add-cart { min-height: 44px; font-size: 14px; }
  .shop-layout { display: block; }
  .filter-panel { margin: -10px -16px 22px; padding: 0 16px; gap: 18px; scrollbar-width: none; }
  .filter-panel a { min-height: 44px; display: flex; align-items: center; }
  .listing-head h1 { font-size: 34px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .filters input, .filters select, .filters button { width: 100%; min-width: 0; min-height: 45px; font-size: 16px; }
  .filters input[name=q] { grid-column: 1 / -1; }
  .filters select { grid-column: 1 / -1; }
  .filters button { grid-column: 1 / -1; }
  .product-detail { gap: 22px; }
  .product-detail h1 { font-size: 34px; }
  .product-detail .product-image { width: 100%; }
  .buy-form input { min-height: 48px; font-size: 16px; }
  .buy-form .button { flex: 1; min-height: 48px; }
  .checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .form-card, .summary, .panel { padding: 19px; }
  .summary { width: 100%; }
  .summary .button { min-height: 49px; }
  .form-grid { gap: 12px; }
  label input, label select, label textarea, .track input, .admin-form input, .admin-form select, .admin-form textarea { font-size: 16px; min-height: 46px; }
  .payment-option { line-height: 1.45; min-height: 48px; }
  .coupon-form input { flex: 1 1 150px; min-width: 0; font-size: 16px; }
  .coupon-form button { flex: 1 1 120px; min-height: 45px; }
  .cart-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "photo info info" "photo qty amount"; gap: 8px 12px; align-items: center; }
  .cart-item img { grid-area: photo; width: 72px; height: 72px; }
  .cart-item>div { grid-area: info; min-width: 0; line-height: 1.4; }
  .cart-item input { grid-area: qty; width: 72px; min-height: 44px; font-size: 16px; }
  .cart-item strong { grid-area: amount; justify-self: end; white-space: nowrap; }
  .cart-item a, .cart-item b { overflow-wrap: anywhere; }
  .track form .button { min-height: 48px; }
  footer { padding: 35px 20px; gap: 20px; }
  footer div:nth-child(2) { flex-wrap: wrap; gap: 15px 22px; }
  .admin-top { padding: 12px 16px; gap: 12px; }
  .admin-top .logo { font-size: 17px; }
  .admin-top>a:last-child { min-height: 44px; display: flex; align-items: center; white-space: nowrap; font-size: 13px; }
  .admin-nav { padding: 0 8px; gap: 0; scrollbar-width: none; }
  .admin-nav a { padding: 15px 12px; min-height: 48px; }
  .admin-main { padding: 25px 16px 45px; min-width: 0; }
  .admin-main h1 { font-size: 34px; }
  .admin-title { gap: 12px; }
  .admin-title .button { white-space: nowrap; padding: 12px; font-size: 14px; }
  .admin-panels { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { gap: 10px; margin: 22px 0; }
  .stats-grid>div { min-width: 0; padding: 18px; }
  .stats-grid b { font-size: 23px; overflow-wrap: anywhere; }
  .admin-row { gap: 10px; min-width: 0; }
  .admin-row span { min-width: 0; overflow-wrap: anywhere; }
  .import-form { align-items: stretch; flex-direction: column; }
  .import-form label { width: 100%; }
  .import-form input { max-width: 100%; }
  .import-form button { min-height: 44px; }
  .table-wrap { overflow: visible; padding: 12px; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tr { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; margin-bottom: 12px; }
  .responsive-table td { border: 0; padding: 8px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; min-width: 0; text-align: right; overflow-wrap: anywhere; }
  .responsive-table td:before { content: attr(data-label); flex: 0 0 72px; text-align: left; color: #937e6c; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .responsive-table td:first-child { display: block; text-align: left; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 2px; }
  .responsive-table td:first-child:before { display: block; margin-bottom: 8px; }
  .responsive-table td:last-child { padding-bottom: 5px; }
  .responsive-table td form { margin: 0; }
  .responsive-table .admin-thumb { vertical-align: middle; }
  .admin-form .button, .settings-form .button { width: 100%; min-height: 48px; }
  .admin-login { margin: 35px 16px; padding: 24px; }
}
@media (max-width: 400px) {
  .site-header { padding: 10px 12px; }
  .logo { font-size: 16px; }
  .logo-mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 25px; }
  .header-actions>a:first-child { display: grid; }
  .header-actions a { min-width: 40px; }
  .header-actions { gap: 0; }
  .category-nav { padding-left: 12px; padding-right: 12px; }
  .container { padding-left: 12px; padding-right: 12px; }
  .filter-panel { margin-left: -12px; margin-right: -12px; padding-left: 12px; }
  .product-body { padding: 10px; }
  .product-title { font-size: 14px; }
  .product-card .price strong { font-size: 16px; }
  .cart-item { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 8px; }
  .cart-item img { width: 62px; height: 62px; }
  .stats-grid>div { padding: 14px; }
}
@media (max-width: 340px) {
  .header-actions>a:first-child { display: none; }
  .products { grid-template-columns: minmax(0, 1fr); }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto; transition-duration: .01ms; animation-duration: .01ms; }
}
