/* Responsive audit fixes, 2026-10-19. Loaded after the existing styles. */
.catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.product-card, .product-content { min-width: 0; }
.product-image-slider { width: calc(100% - 32px); max-width: min(calc(100% - 32px), 33.75vh, 450px); min-width: 0; }
#half .product-image-slider { max-width: min(calc(100% - 32px), 30vh, 400px); }
.product-image-viewport { height: auto; max-height: none; }
.product-qty-btn, .product-arrow { font: inherit; padding: 0; border: 0; cursor: pointer; }
.product-qty-btn { background: transparent; }
.product-qty-btn:focus-visible, .product-arrow:focus-visible,
#mobile-menu-toggle:focus-visible, #sidebar-cart:focus-visible {
    outline: 3px solid #587446; outline-offset: 3px;
}
#catalog .product-qty-btn, #half .product-qty-btn,
#catalog .product-qty-value, #half .product-qty-value {
    min-width: 44px; width: 44px; min-height: 44px; height: 44px;
}
#catalog .product-qty-selector, #half .product-qty-selector { min-height: 44px; }
#catalog .product-qty-value, #half .product-qty-value { display: flex; align-items: center; justify-content: center; }
#half .diameter-btn { min-height: 44px; min-width: 44px; }
.product-arrow { width: 44px; height: 44px; }
.product-arrow:focus-visible { opacity: 1 !important; }
/* Compact only the phone menu; tablet and desktop spacing stays unchanged. */
@media (max-width: 559px) {
    #sidebar { height: 100vh !important; height: 100dvh !important; }
    #sidebar > div:first-child { flex-shrink: 0; padding: 20px 24px 8px !important; }
    #sidebar img { margin-bottom: 16px !important; }
    #sidebar-phone-cart { display: grid !important; grid-template-columns: minmax(0, 1fr) 100px !important; gap: 10px !important; margin-bottom: 0 !important; }
    #sidebar-phone-cart > #sidebar-phone,
    #sidebar-phone-cart > #sidebar-cart { padding: 10px 12px !important; min-height: 44px; }
    #sidebar-phone-cart > #sidebar-phone { padding: 12px 14px !important; width: 100% !important; min-width: 0 !important; }
    #sidebar-phone-cart > #sidebar-cart { padding: 10px 8px !important; width: 100% !important; min-width: 0 !important; }
    #sidebar .sidebar-cart-compact svg { display: none; }
    #sidebar .sidebar-phone-compact .mb-1,
    #sidebar .sidebar-cart-compact .mb-1 { margin-bottom: 2px !important; }
    #sidebar .sidebar-phone-compact .text-xs,
    #sidebar .sidebar-cart-compact .text-xs { font-size: 11px !important; letter-spacing: .06em !important; }
    #sidebar .sidebar-phone-compact .text-base,
    #sidebar .sidebar-cart-compact .text-base { font-size: 15px !important; line-height: 20px !important; }
    #sidebar .sidebar-phone-compact .text-base { font-size: 16px !important; line-height: 22px !important; white-space: nowrap; }
    #sidebar nav { min-height: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
}
@media (max-width: 1439px) {
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 559px) {
    .catalog-grid { grid-template-columns: minmax(0, 1fr); }
    .product-arrow { width: 44px; height: 44px; }
}
@media (min-width: 920px) {
    #sidebar { transform: translateX(0) !important; }
}
@media (max-width: 389px) {
    #sidebar > div:first-child { padding: 20px 20px 8px !important; }
    #sidebar-phone-cart { display: grid !important; grid-template-columns: minmax(0, 1fr) 100px !important; gap: 10px !important; }
    #sidebar-phone, #sidebar-cart { width: 100% !important; max-width: none !important; min-width: 0 !important; margin: 0 !important; }
    #sidebar-phone { padding: 12px 16px !important; }
    #sidebar-phone > div { align-items: center; }
    #sidebar-cart { padding: 12px 16px !important; }
}
@media (max-width: 359px) {
    #sidebar-phone-cart { grid-template-columns: minmax(0, 1fr) 96px !important; }
    #sidebar-phone-cart > #sidebar-phone { padding-left: 8px !important; padding-right: 8px !important; }
}
@media (min-width: 920px) and (max-width: 1199px) {
    #custom-form > .grid { grid-template-columns: minmax(0, 1fr) !important; }
    #custom .max-w-7xl > div { gap: 36px !important; }
}
/* A low viewport needs one continuous form scroll, instead of a tiny field area. */
@media (max-height: 600px) {
    #cart-modal { padding: 8px !important; }
    #cart-modal > div { height: calc(100dvh - 16px) !important; height: calc(100vh - 16px); border-radius: 20px !important; }
    #cart-modal > div > div:first-child { padding: 12px 20px !important; }
    #cart-modal h2 { font-size: 22px !important; }
    #cart-items-list { min-height: 0; padding: 12px 20px !important; }
    #cart-items-list + div { padding: 12px 20px !important; gap: 16px !important; flex-direction: row !important; }
    #btn-checkout { padding: 12px 24px !important; width: auto !important; }
    #checkout-form { display: block; overflow-y: auto; padding: 16px 24px !important; border-radius: 20px !important; }
    #checkout-form.hidden { display: none; }
    #checkout-form > div:first-child { margin-bottom: 16px !important; }
    #checkout-form > div:nth-child(2) { overflow: visible; margin-bottom: 16px !important; padding-right: 0; }
    #checkout-form > div:last-child { padding-top: 16px !important; }
    #checkout-form button[type=submit] { padding: 14px 20px !important; font-size: 16px !important; }
}
