/* Final responsive pass: loaded last so older breakpoint rules cannot distort mobile layouts. */
.filter-disclosure > summary { display: none; }
.filter-disclosure:not([open]) > .filter-content { display: block; }
.filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-heading h3 { margin: 0 !important; }
.filter-heading a { color: var(--blue); font-size: 10px; font-weight: 700; }
.filter-categories a { display: block; padding: 6px 8px; border-radius: 8px; font-size: 11px; }
.filter-categories a.active { background: var(--bg); color: var(--blue); font-weight: 800; }

@media (max-width: 760px) {
    body { min-width: 0; overflow-x: clip; }
    .container { max-width: 100%; }
    .site-header { padding-bottom: 5px !important; }
    .header-row { padding-top: 9px !important; }
    .brand-images { justify-self: end; }
    .header-actions { justify-self: start; }
    .header-search input { font-size: 11px !important; }
    .main-nav { overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; }
    .main-nav a { flex: 0 0 auto; scroll-snap-align: start; }

    .page-space { padding-top: 20px !important; }
    .page-heading { align-items: end; margin-bottom: 15px !important; }
    .page-heading h1 { font-size: 24px !important; }
    .page-heading p { margin: 0; }
    .catalog-layout { gap: 13px !important; }
    .catalog-layout > * { min-width: 0; }
    .filters { display: block !important; width: 100%; min-width: 0; max-width: 100%; padding: 0 !important; overflow: hidden !important; }
    .filter-disclosure, .filter-content, .filter-form { width: 100%; min-width: 0; max-width: 100%; }
    .filter-disclosure > summary {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        min-height: 48px; padding: 10px 14px; list-style: none; cursor: pointer;
        color: var(--navy); font-size: 12px; font-weight: 800;
    }
    .filter-disclosure > summary::-webkit-details-marker { display: none; }
    .filter-disclosure > summary::after { content: '+'; display: grid; place-items: center; width: 26px; height: 26px; margin-right: auto; border-radius: 8px; background: var(--bg); font-size: 18px; }
    .filter-disclosure[open] > summary::after { content: '−'; }
    .filter-disclosure > summary small { color: var(--muted); font-size: 9px; font-weight: 500; }
    .filter-disclosure:not([open]) > .filter-content { display: none; }
    .filter-content { padding: 0 13px 14px; border-top: 1px solid var(--line); }
    .filter-heading { padding: 12px 0 8px; }
    .filter-categories { display: flex; width: calc(100% + 26px); max-width: none; gap: 6px; margin-inline: -13px; padding: 0 13px 10px; overflow-x: auto; scrollbar-width: none; }
    .filter-categories::-webkit-scrollbar { display: none; }
    .filter-categories a { flex: 0 0 auto; white-space: nowrap; border: 1px solid var(--line); background: var(--card); }
    .filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important; margin: 0 !important; padding-top: 10px !important; }
    .filter-form label { min-width: 0; margin: 0 !important; }
    .filter-form select, .filter-form input { width: 100%; min-width: 0 !important; margin-top: 4px; }
    .filter-form .price-filter { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 8px; }
    .filter-form .check { align-self: center; min-height: 36px; }
    .filter-form .mini-button { align-self: end; margin: 0 !important; }

    .product-grid { align-items: stretch; }
    .product-card { display: flex; min-height: 100%; flex-direction: column; }
    .product-image { flex: 0 0 auto; }
    .product-body { display: flex; min-width: 0; flex: 1; flex-direction: column; }
    .product-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .rating { margin-top: auto !important; white-space: nowrap; }
    .product-bottom { gap: 6px; }
    .product-bottom > div { min-width: 0; }
    .product-bottom strong { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; }
    .quick-add { flex: 0 0 auto; }
    .card-tools { z-index: 3; }

    .product-detail > *, .review-layout > *, .qa-layout > * { min-width: 0; }
    .review-layout, .qa-layout { grid-template-columns: minmax(0, 1fr) !important; }
    .community-feed, .login-prompt, .empty-community, .content-panel, .rating-summary, .ask-card { width: 100%; min-width: 0; }
    .product-anchor-nav { max-width: 100%; overscroll-behavior-inline: contain; scrollbar-width: none; }
    .product-anchor-nav::-webkit-scrollbar { display: none; }
    .detail-info h1 { overflow-wrap: anywhere; font-size: 25px !important; }
    .detail-info select { min-width: 0; }
    .content-panel { padding: 18px; overflow-wrap: anywhere; }
    .spec-list > div { grid-template-columns: minmax(90px, 110px) minmax(0, 1fr); }

    .hero { text-align: right; }
    .hero-actions .button { flex: 1 1 135px; }
    .ecosystem-watermark { width: auto !important; max-width: 100%; overflow: hidden; font-size: 52px !important; }
    .personalized-grid { direction: rtl; padding-inline: 1px; scroll-padding-inline: 1px; }
    .personalized-grid .recommended-item { flex-basis: min(72vw, 270px) !important; }
    .personalized-grid .recommended-item:first-child { margin-right: 0; }

    .cart-layout, .checkout-layout { gap: 16px !important; }
    .cart-list, .form-card, .order-summary { min-width: 0; }
    .cart-item { grid-template-columns: 64px minmax(0,1fr) !important; gap: 11px !important; }
    .cart-thumb { width: 64px; height: 64px; }
    .cart-item > strong, .cart-item > b { grid-column: 2; }
    .orders-table article { min-width: 0; }
    .pagination nav > div:last-child { gap: 4px; overflow-x: auto; }
}

@media (max-width: 420px) {
    .container { width: calc(100% - 20px) !important; }
    .product-grid { gap: 8px !important; }
    .product-image { height: 132px !important; min-height: 132px !important; }
    .product-badges b, .product-badges i { padding-inline: 5px !important; font-size: 8px !important; }
    .product-body { padding: 10px !important; }
    .product-title { min-height: 38px !important; font-size: 11.5px !important; }
    .product-bottom strong { font-size: 11.5px !important; }
    .quick-add { width: 31px !important; height: 31px !important; }
    .section-head { gap: 10px; }
    .section-head > a { white-space: nowrap; }
}

@media (max-width: 340px) {
    .product-grid { grid-template-columns: 1fr !important; }
    .product-card { display: flex; }
    .product-image { width: 100%; height: 168px !important; min-height: 168px !important; }
    .product-body { padding: 12px !important; }
    .product-title { min-height: 0 !important; }
    .filter-form { grid-template-columns: 1fr; }
    .filter-form .price-filter { grid-column: 1; }
    .account-stats { grid-template-columns: 1fr !important; }
    .account-stats article:last-child { grid-column: auto !important; }
}
