.react-products-page {
    background: var(--theme-background);
    color: var(--theme-text);
    font-family: var(--theme-font-family);
}

.react-products-page * {
    box-sizing: border-box;
}

.rtp-title {
    min-height: 190px;
    display: flex;
    align-items: center;
    background-color: var(--theme-box-background);
    background-position: center;
    background-size: cover;
}

.rtp-title-inner,
.rtp-container {
    width: min(100% - 30px, 1320px);
    margin: 0 auto;
}

.rtp-heading {
    margin: 0;
    font-size: clamp(24px, 4vw, 44px);
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: 0;
}

.rtp-section {
    padding: 34px 0;
}

.rtp-subtitle-row,
.rtp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.rtp-subtitle {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.rtp-child-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.rtp-child {
    position: relative;
    display: block;
    min-height: 150px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background: var(--theme-box-background);
}

.rtp-child img {
    display: block;
    width: 100%;
    height: 175px;
    object-fit: cover;
}

.rtp-child span {
    position: absolute;
    inset: auto 10px 10px;
    display: inline-flex;
    width: calc(100% - 20px);
    justify-content: center;
    padding: 8px 10px;
    background: rgba(0, 0, 0, .58);
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
}

.rtp-sort {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.rtp-sort select {
    min-height: 38px;
    padding: 7px 34px 7px 12px;
    border: 1px solid color-mix(in srgb, var(--theme-text), transparent 78%);
    background: var(--theme-background);
    color: var(--theme-text);
    font: inherit;
}

#react-spa-root .rtp-layout-buttons {
    display: inline-flex;
    gap: 15px;
    align-items: center;
}

#react-spa-root .rtp-layout-button,
#react-spa-root .rtp-layout-button.active,
#react-spa-root .rtp-layout-button:hover {
    appearance: none;
    width: auto !important;
    height: 24px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--theme-button-background) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    cursor: pointer;
    box-shadow: none !important;
    min-height: 0 !important;
    transition: opacity .2s ease;
}

#react-spa-root .rtp-layout-button {
    opacity: .35;
}

#react-spa-root .rtp-layout-icon {
    display: grid;
    grid-template-columns: repeat(var(--cols), 4px);
    grid-template-rows: repeat(2, 4px);
    gap: 5px;
}

#react-spa-root .rtp-layout-icon i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    display: block;
}

#react-spa-root .rtp-layout-button:hover,
#react-spa-root .rtp-layout-button.active {
    opacity: 1;
}

.rtp-grid {
    display: grid;
    gap: 18px 14px;
}

.rtp-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rtp-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rtp-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rtp-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rtp-grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.rtp-product {
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.rtp-product-media {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--theme-box-background);
    aspect-ratio: 5 / 7;
}

.rtp-product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rtp-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 9px;
    background: var(--theme-button-background);
    color: var(--theme-button-text);
    font-size: 12px;
}

.rtp-product-info {
    padding: 12px 4px 0;
    text-align: center;
}

.rtp-product-title {
    display: block;
    min-height: 40px;
    color: inherit;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.35;
}

.rtp-price-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    font-size: 14px;
}

.rtp-old-price {
    opacity: .58;
    text-decoration: line-through;
}

.rtp-product-actions {
    margin-top: 12px;
}

.rtp-product-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 180px);
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid var(--theme-button-background);
    background: var(--theme-button-background);
    color: var(--theme-button-text);
    font: inherit;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.rtp-product-button:disabled {
    cursor: not-allowed;
    opacity: .52;
}

.rtp-empty {
    padding: 60px 0;
    text-align: center;
}

.rtp-pager {
    margin-top: 34px;
}

.rtp-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 34px;
}

.rtp-pagination button {
    min-width: 38px;
    min-height: 38px;
    border: 1px solid color-mix(in srgb, var(--theme-text), transparent 78%);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.rtp-pagination button.active {
    border-color: var(--theme-button-background);
    background: var(--theme-button-background);
    color: var(--theme-button-text);
}

@media (max-width: 1199px) {
    .rtp-grid.cols-5,
    .rtp-grid.cols-6 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .rtp-child-grid,
    .rtp-grid.cols-3,
    .rtp-grid.cols-4,
    .rtp-grid.cols-5,
    .rtp-grid.cols-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rtp-toolbar,
    .rtp-subtitle-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 575px) {
    .rtp-title-inner,
    .rtp-container {
        width: min(100% - 20px, 1320px);
    }

    .rtp-section {
        padding: 26px 0;
    }

    .rtp-grid {
        gap: 14px 10px;
    }

    .rtp-product-title {
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    #react-spa-root .rtp-layout-buttons {
        display: none !important;
    }
}

/* Keep Safari's native arrow spacing from adding to the sort control padding. */
.fashion-storefront .rtp-sort{position:relative}
.fashion-storefront .rtp-sort select{-webkit-appearance:none;appearance:none;padding-inline:12px 32px;background-image:none;max-width:100%;box-sizing:border-box}
.fashion-storefront .rtp-sort::after{content:"";position:absolute;inset-inline-end:12px;top:calc(50% - 5px);width:7px;height:7px;border-inline-end:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);pointer-events:none}

/* Store-wide category-page controls; absent settings preserve the original grid. */
.rtp-subcategories .rtp-child-grid{grid-template-columns:repeat(var(--subcategory-columns,4),minmax(0,1fr))}
.rtp-subcategories .rtp-child img{height:var(--subcategory-height,175px)}
.rtp-subcategories .rtp-child-carousel{display:grid;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:calc((100% - (var(--subcategory-columns,4) - 1)*14px)/var(--subcategory-columns,4));overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:12px;overscroll-behavior-inline:contain}
.rtp-child-carousel>.rtp-child{scroll-snap-align:start}
.rtp-subcategory-below .rtp-child,.rtp-subcategory-round .rtp-child{background:transparent;min-height:0}
.fashion-storefront #react-spa-root :is(.rtp-subcategory-below,.rtp-subcategory-round) .rtp-child>span{position:static;display:block;width:auto;background:transparent;color:var(--theme-text)!important;padding:12px 0;text-align:center}
.rtp-subcategory-round .rtp-child img{height:auto;aspect-ratio:1;object-fit:cover;border-radius:50%;max-width:100%}
@media(max-width:991px){.rtp-subcategories{--subcategory-columns:2!important}}
@media(max-width:767px){.rtp-subcategories .rtp-child-grid{grid-template-columns:repeat(var(--subcategory-mobile-columns,2),minmax(0,1fr))}.rtp-subcategories .rtp-child-carousel{grid-template-columns:none;grid-auto-columns:calc((100% - (var(--subcategory-mobile-columns,2) - 1)*14px)/var(--subcategory-mobile-columns,2))}.rtp-subcategories .rtp-child img{height:var(--subcategory-mobile-height,175px)}.rtp-subcategory-round .rtp-child img{height:auto}}

/* Reuse the homepage design templates while keeping category-page sizing independent. */
.rtp-native-subcategories .dynamic-home-section{padding-block:0!important}
.rtp-native-subcategories .dynamic-home-section>.container{max-width:none;padding-inline:0}
.rtp-native-subcategories :is(.retail-category-grid,.smart-category-grid,.pro-category-grid,.catalogue-category-grid,.masonry-layout-v2,.grid-3-layout-md,.elevate-category-grid){display:grid!important;grid-template-columns:repeat(var(--subcategory-columns,4),minmax(0,1fr))!important;gap:14px!important;margin-inline:0!important}
.rtp-native-subcategories :is(.retail-category-grid,.pro-category-grid,.masonry-layout-v2,.elevate-category-grid)>*{width:auto!important;max-width:none;padding-inline:0!important;min-width:0}
.rtp-native-subcategories :is(.collection-image img,.tf-banner-collection img,.elevate-category-image img){height:var(--subcategory-height,175px)!important;min-height:0!important;object-fit:cover;width:100%}
.rtp-native-subcategories .dynamic-home-track{display:grid;grid-template-columns:none!important;grid-auto-flow:column;grid-auto-columns:calc((100% - (var(--subcategory-columns,4) - 1)*14px)/var(--subcategory-columns,4))!important;gap:14px!important;overflow-x:auto;scroll-snap-type:x mandatory}
.rtp-native-subcategories .dynamic-home-track>*{width:auto!important;min-width:0;scroll-snap-align:start}
.rtp-native-subcategories .dynamic-home-slider-controls{display:flex;justify-content:center;gap:12px;margin-top:12px}
.rtp-native-subcategories .dynamic-home-slider-controls button{width:40px;height:40px;border-radius:50%;border:0;background:var(--theme-button-background);color:var(--theme-button-text);font-size:24px}
.rtp-native-subcategories .flat-title:empty{display:none}
.rtp-native-sphere .collection-image{aspect-ratio:1!important;width:100%;height:auto!important;border-radius:50%!important}
.rtp-native-sphere .collection-image img{height:100%!important}
@media(max-width:767px){.rtp-native-subcategories{--subcategory-columns:var(--subcategory-mobile-columns,2)!important}.rtp-native-subcategories :is(.collection-image img,.tf-banner-collection img,.elevate-category-image img){height:var(--subcategory-mobile-height,175px)!important}.rtp-native-sphere .collection-image img{height:100%!important}}

.rtp-native-smart_pro .dynamic-home-track{grid-auto-columns:100%!important}.rtp-native-smart_pro .smart-pro-category-card{height:var(--subcategory-height,175px)}
@media(max-width:767px){.rtp-native-smart_pro .smart-pro-category-card{height:var(--subcategory-mobile-height,175px)}}
