.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

.mobile-filter-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 20px;
    background: #e41d2f;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    text-align: left;
}

.mobile-filter-toggle:hover {
    background: #b41427;
    color: white;
}

.mobile-filter-toggle:focus {
    box-shadow: 0 0 0 2px rgba(228, 29, 47, 0.3);
    outline: none;
}

.mobile-filter-toggle .filter-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.mobile-filter-toggle[aria-expanded="true"] .filter-arrow {
    transform: rotate(180deg);
}

.collapsing {
    transition: height 0.35s ease;
}

@media screen and (max-width: 1340px) {
    .shop-wrapper.parent {
        padding: 20px;
        gap: 20px;
    }
    
    .shop-wrapper.parent .div3 {
        padding: 20px;
    }
    
    .shop-wrapper.parent .div4 {
        padding: 0;
    }
    
    .shop-collections-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.2em;
    }
    
    .shop-collections-item {
        height: 450px;
    }
    
    .filter-block {
        padding: 0 1.5em;
    }
    
    #shop-filter-form {
        padding: 0 30px 0px 0px;
    }

    .shop-header-block {
        padding: 0;
    }
}

@media screen and (max-width: 1024px) {
    .shop-wrapper.parent {
        grid-template-columns: 300px 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 20px;
        padding: 20px;
    }
    
    .shop-wrapper.parent .div1 { 
        grid-area: 1 / 1 / 5 / 2;
    }
    
    .shop-wrapper.parent .div2 { 
        grid-area: 1 / 2 / 2 / 3;
    }
    
    .shop-wrapper.parent .div3 { 
        grid-area: 2 / 2 / 4 / 3;
    }
    
    .shop-wrapper.parent .div4 { 
        grid-area: 4 / 2 / 5 / 3;
    }
    
    .shop-wrapper.parent.is-collection-view {
        grid-template-columns: 250px 1fr 250px;
        grid-template-rows: auto 1fr;
    }
    
    .shop-wrapper.parent.is-collection-view .div1 { 
        grid-area: 1 / 1 / 3 / 2;
    }
    
    .shop-wrapper.parent.is-collection-view .div2 {
        grid-area: 1 / 2 / 2 / 4;
    }
    
    .shop-wrapper.parent.is-collection-view .div3 {
        grid-area: 2 / 2 / 3 / 3;
    }
    
    .shop-wrapper.parent.is-collection-view .div4 {
        grid-area: 2 / 3 / 3 / 4;
    }
    
    .filter-block {
        padding: 0 1.5em;
    }
    
    #shop-filter-form {
        padding: 0 30px 0px 0px;
    }
}

@media screen and (max-width: 767.98px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-stack {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .mobile-center {
        text-align: center;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-full-width {
        width: 100%;
        max-width: none;
    }
    
    .filter-block {
        background: #f8f9fa;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
        order: 1;
    }
    
    .filter-title {
        display: none;
    }
    
    .collapse:not(.show) {
        display: none;
    }
    
    .collapse.show {
        display: block;
    }
    
    #shop-filter-form {
        padding: 0;
        margin-top: 10px;
    }
    
    .tag,
    .filter-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .tag {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .filter-item span {
        font-size: 14px;
    }
    
    .shop-wrapper.parent,
    .shop-wrapper.parent.is-collection-view {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 10px;
        margin: 0;
        grid-template-columns: none;
        grid-template-rows: none;
    }
    
    .shop-wrapper.parent > div,
    .shop-wrapper.parent.is-collection-view > div {
        grid-area: unset;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .navbar-block {
        order: 2;
    }
    
    .navbar-title {
        font-size: 24px;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .navbar-line {
        justify-content: center;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 5px 0;
    }
    
    .navbar-line::-webkit-scrollbar {
        display: none;
    }
    
    .navbar-chip {
        flex-shrink: 0;
        font-size: 13px;
        padding: 6px 12px;
        white-space: nowrap;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .div3, .div4 {
        order: 3;
    }
    
    .shop-header-block {
        order: 3;
        padding: 1.5rem 1rem;
        height: auto;
        min-height: 300px;
        background-position: center;
    }
    
    .shop-hero-inner {
        justify-content: center;
    }
    
    .shop-hero-left {
        align-items: center;
        text-align: center;
    }
    
    .shop-hero-subtitle {
        font-size: 28px;
    }
    
    .product-thumb {
        width: 100px;
    }
    
    .shop-products-header {
        order: 2;
        height: auto;
        min-height: 200px;
        padding: 15px;
    }
    
    .shop-products-header__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
    
    .shop-products-header__left,
    .shop-products-header__right {
        width: 100%;
        justify-content: center;
        align-items: center;
        max-width: none;
    }
    
    .shop-products-header__title {
        font-size: 32px;
        line-height: 90%;
    }
    
    .shop-products-header__buttons {
        flex-direction: column;
        gap: 10px;
        max-width: 280px;
        width: 100%;
    }
    
    .shop-products-header__btn {
        width: 100%;
        font-size: 13px;
        padding: 10px 14px;
        text-align: center;
        justify-content: center;
        min-height: 44px;
    }
    
    .shop-products-header__right {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        max-width: none;
        gap: 15px;
        padding: 10px;
    }
    
    .shop-products-header__martindale {
        transform: scale(0.9);
    }
    
    .shop-products-grid {
        order: 3;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 10px;
    }
    
    .shop-product-card {
        width: 100%;
    }
    
    .shop-product-card .card-thumb {
        width: 100%;
        height: 140px;
    }
    
    .shop-product-card .card-title {
        font-size: 14px;
    }
    
    .shop-products-preview {
        order: 4;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 12px;
        margin: 0;
    }
    
    .collection-name {
        font-size: 20px;
        text-align: center;
    }
    
    .preview-image-flip {
        aspect-ratio: 1;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .preview-tabs {
        justify-content: center;
        width: 100%;
    }
    
    .preview-tabs .tab-btn {
        flex: 1;
        font-size: 14px;
        padding: 0.25rem 0.8rem;
        text-align: center;
        min-height: 44px;
    }
    
    .shop-collections-grid {
        order: 4;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 20px;
    }
    
    .shop-collections-item {
        height: 320px;
        padding: 1.5rem 1rem 1rem;
    }
    
    .shop-collections-title {
        font-size: 20px;
    }
    
    .shop-collections-descr {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .shop-wrapper.parent,
    .shop-wrapper.parent.is-collection-view {
        padding: 8px;
        gap: 12px;
    }
    
    .filter-block {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .mobile-filter-toggle {
        font-size: 15px;
    }
    
    .tag,
    .filter-item span {
        font-size: 13px;
        padding: 6px 8px;
    }
    
    .navbar-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .navbar-chip {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .shop-header-block {
        padding: 1rem 0.8rem;
        min-height: 250px;
    }
    
    .shop-hero-title {
        font-size: 13px;
    }
    
    .shop-hero-subtitle {
        font-size: 24px;
    }
    
    .product-thumb {
        width: 80px;
    }
    
    .product-name-wrapper {
        width: 70px;
    }
    
    .product-name {
        font-size: 11px;
    }
    
    .shop-hero-cta {
        font-size: 13px;
        padding: 7px 10px;
    }
    
    .shop-products-header {
        padding: 12px;
        min-height: 500px;
    }
    
    .shop-products-header__title {
        font-size: 26px;
    }
    
    .shop-products-header__label {
        font-size: 14px;
    }
    
    .shop-products-header__buttons {
        max-width: none;
    }
    
    .shop-products-header__btn {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .shop-products-header__info .chip .value,
    .shop-products-header__info span {
        font-size: 12px;
    }
    
    .shop-products-header__martindale {
        transform: scale(0.7);
    }
    
    .shop-products-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 8px;
    }
    
    .shop-product-card .card-thumb {
        height: 180px;
    }
    
    .shop-product-card .card-title {
        font-size: 15px;
    }
    
    .shop-products-preview {
        padding: 12px;
    }
    
    .collection-name {
        font-size: 18px;
    }
    
    .preview-tabs .tab-btn {
        font-size: 13px;
        padding: 0.2rem 0.6rem;
    }
    
    .fabric-item strong,
    .fabric-item span,
    .care-text {
        font-size: 13px;
    }
    
    .shop-collections-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px 0;
    }
    
    .shop-collections-item {
        height: 280px;
        max-width: 320px;
        width: 100%;
        padding: 1.2rem 0.8rem 0.8rem;
    }
    
    .shop-collections-title {
        font-size: 18px;
    }
    
    .shop-collections-span {
        font-size: 14px;
    }
    
    .shop-collections-btn {
        font-size: 14px;
        padding: 7px 10px;
    }
}

@media screen and (max-width: 360px) {
    .shop-wrapper.parent,
    .shop-wrapper.parent.is-collection-view {
        padding: 6px;
        gap: 10px;
    }
    
    .navbar-title {
        font-size: 18px;
    }
    
    .navbar-chip {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .shop-collections-item {
        height: 260px;
        padding: 1rem 0.6rem 0.6rem;
    }
    
    .shop-collections-title {
        font-size: 16px;
        line-height: 95%;
    }
    
    .shop-products-header__title {
        font-size: 22px;
    }
    
    .collection-name {
        font-size: 16px;
    }
    
    .filter-block,
    .shop-products-preview {
        padding: 12px;
    }
    
    .mobile-filter-toggle {
        font-size: 14px;
        padding: 12px 16px;
    }
}

@media screen and (max-width: 768px) and (orientation: landscape) {
    .shop-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .shop-collections-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 0 20px;
    }
    
    .shop-collections-item {
        height: 240px;
    }
    
    .shop-header-block {
        min-height: 200px;
    }
    
    .shop-products-header {
        min-height: 150px;
    }
    
    .collection-toggle {font-size:15px}
    .collection-item span {font-size:14px}
}

@media screen and (max-width: 768px) {
    .mobile-filter-toggle:focus-visible {
        box-shadow: 0 0 0 3px rgba(228, 29, 47, 0.3);
        border-radius: 10px;
        outline: none;
    }
    
    .mobile-filter-toggle:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .tag:active,
    .filter-item:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .navbar-chip,
    .tag,
    .filter-item,
    .mobile-filter-toggle,
    .preview-tabs .tab-btn,
    .shop-products-header__btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .touch-device *:focus:not(:focus-visible) {
        outline: none;
    }
    
    .touch-device .shop-product-card:active,
    .touch-device .shop-collections-item:active,
    .touch-device .navbar-chip:active,
    .touch-device .tag:active,
    .touch-device .mobile-filter-toggle:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .mobile-filter-toggle:focus-visible,
    .navbar-chip:focus-visible,
    .tag:focus-visible,
    .shop-products-header__btn:focus-visible {
        box-shadow: 0 0 0 3px rgba(228, 29, 47, 0.3);
        border-radius: 8px;
        outline: none;
    }
    
    .filter-title,
    .navbar-title,
    .collection-name,
    .shop-products-header__title {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
    .shop-collections-item,
    .shop-header-block {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .fabric-collection-dropdowns {    
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .mobile-filter-toggle .filter-arrow {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .shop-collections-item,
    .shop-product-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .shop-collections-item:active,
    .shop-product-card:active {
        transform: scale(0.98);
    }
}

@media screen and (max-width: 768px) {
    .desktop-only,
    .hide-mobile {
        display: none;
        visibility: hidden;
    }
    
    .mobile-only,
    .show-mobile {
        display: block;
        visibility: visible;
    }
    
    .shop-wrapper.parent,
    .shop-wrapper.parent.is-collection-view {
        display: flex;
        grid-template-columns: unset;
        grid-template-rows: unset;
        grid-template-areas: unset;
    }
    
    .shop-wrapper.parent > *,
    .shop-wrapper.parent.is-collection-view > * {
        grid-area: unset;
        grid-column: unset;
        grid-row: unset;
    }
}

@supports not (display: grid) {
    @media screen and (max-width: 768px) {
        .shop-wrapper.parent,
        .shop-wrapper.parent.is-collection-view {
            display: block;
        }
        
        .shop-wrapper.parent > div,
        .shop-wrapper.parent.is-collection-view > div {
            width: 100%;
            margin-bottom: 15px;
        }
    }
}