.search-results-grid,
.storefront-product-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 32px 16px;
    box-sizing: border-box;
    margin-top: 20px;
}

.search-result-card {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 5px;
}

.search-result-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--main-border-radius);
    background: #f3f1f4;
    display: block;
    position: relative;
    isolation: isolate;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.search-result-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.search-result-photo.is-image-loaded::after {
    opacity: 1;
}

.search-result-photo img {
    width: 100%;
    height: 100%;
    display: block;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    object-position: center 34%;
    filter: saturate(1.1);
}

.search-result-photo-main {
    position: absolute;
    inset: 0;
    object-fit: cover;
}

.spc-badge-stack {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 4;
    display: grid;
    justify-items: start;
    gap: 6px;
    pointer-events: none;
}

.spc-badge {
    min-height: 20px;
    padding: 0 8px;
    border-radius: 10px;
    background: rgb(255 255 255);
    color: #232333;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(24, 24, 38, 0.14);
    white-space: nowrap;
}

.spc-badge svg {
    width: 12px;
    height: 12px;
    color: #ff0f8a;
    flex: 0 0 auto;
}

.spc-badge--sale svg {
    color: #ec0078;
}

.spc-badge--hit svg {
    color: #ff0f8a;
}

.spc-badge--clearance svg {
    color: #ff0f8a;
}

.storefront-product-card--has-video {
    position: relative;
}

.spc-video-badge {
    position: absolute;
    top: -12px;
    left: 10px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 0 8px;
    background: #83b72c;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
}

.spc-video-badge::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 8px;
    border-top: 6px solid #83b72c;
    border-right: 6px solid transparent;
}

.spc-video-badge svg {
    width: 13px;
    height: 13px;
}

.spc-favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #2b2b34;
    box-shadow: 0 10px 24px rgba(24, 24, 38, 0.16);
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.spc-favorite-btn:hover,
.spc-favorite-btn:focus-visible {
    transform: translateY(-1px);
    background: #ffffff;
    color: #ff0f8a;
    box-shadow: 0 14px 28px rgba(24, 24, 38, 0.2);
    outline: none;
}

.spc-favorite-btn.is-active,
.spc-favorite-btn[aria-pressed="true"] {
    background: #ff0f8a;
    color: #ffffff;
}

.spc-favorite-btn svg {
    width: 18px;
    height: 18px;
}

.spc-favorite-btn.is-active svg,
.spc-favorite-btn[aria-pressed="true"] svg {
    fill: currentColor;
}

.search-result-photo-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 180ms ease;
    pointer-events: none;
}

.search-result-photo.is-video-preview .search-result-photo-video {
    opacity: 1;
}

.spc-badge--new svg {
    color: #0582f9;
}

.spc-badge--previous-collection {
    min-height: 24px;
    max-width: calc(100% - 20px);
    border: 1px solid #e7b822;
    border-radius: 6px;
    background: #ffdf71;
    color: #3d2f00;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
}

.spc-badge--previous-collection svg {
    color: #765300;
}

.search-result-photo-main {
    opacity: 0;
    transition: opacity 0.22s ease;
}

.search-result-photo.is-image-loaded .search-result-photo-main {
    opacity: 1;
}

.search-result-photo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c8797;
    font-size: 14px;
    text-align: center;
    padding: 16px;
    box-sizing: border-box;
}

.search-result-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    justify-content: flex-start;
    align-items: flex-start;
}

.search-result-brand-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.search-result-title {
    display: block;
    margin: 0;
    color: #9d9da5;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.search-result-title > span:last-child {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    position: absolute;
    left: 5px;
    bottom: 5px;
    z-index: 2;
    margin: 0;
    width: 50px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--main-border-radius);
    background: #ffffff;
    color: #0582f9;
    font-size: var(--main-font-size-1);
    line-height: 1.2;
    text-align: center;
    text-align-last: center;
    box-sizing: border-box;
}

.search-result-price strong {
    font-weight: bold;
}

/* spc = storefront-product-card */
.spc-info-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.spc-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.spc-title {
    margin: 0;
    font-weight: 500;
    font-size: var(--main-font-size-1);
    color: #1a1a2e;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spc-brand {
    font-size: calc(var(--main-font-size-1) * 0.82);
    color: #0582f9;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.spc-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
    gap: 1px;
}

.spc-price-sale {
    font-weight: 500;
    font-size: var(--main-font-size-1);
    color: #1db954;
    line-height: 1.2;
    white-space: nowrap;
}

.spc-price-regular {
    font-weight: 500;
    font-size: var(--main-font-size-1);
    color: #1db954;
    line-height: 1.2;
    white-space: nowrap;
}

.spc-price-original {
    text-decoration: line-through;
    color: #a0a0ab;
    font-size: calc(var(--main-font-size-1) * 0.82);
    font-weight: 400;
    line-height: 1.1;
    white-space: nowrap;
}

.spc-colors {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2px;
}

.spc-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    flex: 0 0 14px;
}

/* used in product.php brand block */
.verified-brand-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    margin-right: 4px;
    flex: 0 0 14px;
}

.verified-brand-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.verified-brand-name {
    color: #000000;
    font-size: var(--main-font-size-1);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1000px) {
    .search-results-grid,
    .storefront-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 32px 16px;
    }
}

@media (max-width: 700px) {
    .search-results-grid,
    .storefront-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 10px;
    }

    .verified-brand-name {
        font-size: 12px;
    }

    body.is-catalog-mobile-grid-compact .search-results-grid,
    body.is-catalog-mobile-grid-compact .storefront-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-flow: dense;
        gap: 1px !important;
    }

    body.is-catalog-mobile-grid-compact .search-result-card:nth-child(8n + 2) {
        grid-column: span 2;
        grid-row: span 2;
    }

    body.is-catalog-mobile-grid-compact .search-result-photo {
        border-radius: 0;
    }

    body.is-catalog-mobile-grid-compact .spc-favorite-btn {
        top: 5px;
        right: 5px;
        width: 30px;
        height: 30px;
    }

    body.is-catalog-mobile-grid-compact .spc-favorite-btn svg {
        width: 15px;
        height: 15px;
    }

    body.is-catalog-mobile-grid-compact .search-result-meta {
        display: none;
    }
}
