#whole-page-wrapper {
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Responsive product grid — 3 to 6 items per row based on screen width.
 * This applies only to desktop or tablet view.
 */
.s-result-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}

/* 6 per row on extra-wide screens */
@media (min-width: 1800px) {
    .s-result-list {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 5 per row on wide screens */
@media (min-width: 1400px) and (max-width: 1799px) {
    .s-result-list {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 4 per row (default) for medium screens — handled by base rule */

/* 3 per row on smaller screens */
@media (max-width: 1023px) {
    .s-result-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.s-result-item {
    min-width: 0;
}

/* Card container */
.puis-card-container.s-card-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

/* Product image area */
.s-product-image-container {
    text-align: center;
}

.product-image-bg {
    background-color: #F7F7F7;
    border: none;
    border-radius: 8px;
    width: 100%;
}

.product-image-bg img {
    max-width: 85%;
    max-height: 85%;
    mix-blend-mode: multiply;
}

.product-image-bg > div {
    background: transparent !important;
}

/* Card content below image */
.s-card-content {
    padding: 0 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Color swatch section — single row, no wrapping */
.s-color-swatch-section,
.s-color-swatch-section .a-unordered-list,
.s-color-swatch-section ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    padding: 4px 0 0 0;
    margin: 0;
    list-style: none;
}

.s-color-swatch-section li {
    padding: 0 !important;
    margin: 0 !important;
}

/* Color circle swatches on product cards */
.card-color-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    margin-right: 4px;
    cursor: pointer;
}

/*
 * Size refinement grid — AUI <a:box boxType="thumbnail"> renders individual boxes
 * but doesn't provide a wrapping grid layout. Custom flex-wrap ensures size boxes
 * flow to the next line when there are many sizes (e.g. 10+ shoe sizes).
 */
.s-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 16px;
}

/* Make size boxes clickable and ensure short labels (e.g. "5") don't collapse too narrow */
.s-size-grid .a-box {
    cursor: pointer;
    min-width: 42px;
    text-align: center;
}

/* Visual indicator for currently selected size refinement */
.s-size-box-selected {
    border-color: #007185;
    border-width: 2px;
    background-color: #edfdff;
    font-weight: 700;
}

/* styles for mobile screens only*/
@media (max-width: 480px) {
    .s-card-content {
        padding: 0 8px 8px;
    }

    /* Override AUI's default 5% margin-right on product grid columns */
    .s-product-grid-row div.a-column {
        margin-right: 0;
        width: 49%;
        box-sizing: border-box;
    }
}

/* Mobile filter sheet — two-panel layout */
.s-filter-left-col { background-color: #F7FAFA; }
.s-filter-group-item { padding: 12px 8px; cursor: pointer; border-left: 3px solid transparent; }
.s-filter-group-active { border-left-color: #2162A1; background-color: #FFFFFF; }

/* Mobile filter sheet — layout */
.s-filter-sheet-open {
    height: var(--filter-sheet-height);
    max-height: var(--filter-sheet-height);
    top: auto;
}
.s-filter-sheet-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}
.s-filter-sheet-open .s-filter-left-col,
.s-filter-sheet-open .s-filter-right-col {
    height: var(--filter-panel-height);
}
.s-filter-scrollable { flex: 1; min-height: 0; overflow: hidden; }
.s-filter-bottom-bar { flex-shrink: 0; padding: 0 14px; }

/* Mobile filter button — active count badge */
.s-filter-count-badge {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 40px;
    background: #2162A1;
    color: var(--Text-colors-Inverse, #fff);
    font-size: 12px;
    font-weight: 700;
}

/* Limit filter sheet height to not cover full screen */
.a-sheet-web.a-sheet-full-screen {
    height: 85vh !important;
    max-height: 85vh !important;
}


/* Un-bold the Cancel text in filter sheet header */
.a-sheet-web .a-sheet-close {
    font-weight: normal !important;
}
