.ds-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(222px, 1fr));
    gap: var(--space-32);
}

.ds-product-grid__item {
    min-width: 0;
}

.ds-product-card {
    position: relative;
    min-height: 384px;
    border: 1px solid var(--ui-border-color);
    border-radius: var(--radius-10);
    padding: 24px 8px 16px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ds-product-card__sponsored {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 1px solid var(--ui-border-color);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    background: #ffffff;
}

.ds-product-card__image-shell {
    position: relative;
    min-height: 164px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.ds-product-card__image {
    width: 100%;
    max-width: 148px;
    max-height: 148px;
    object-fit: contain;
    display: block;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.ds-product-card.is-image-loaded .ds-product-card__image {
    opacity: 1;
}

.ds-product-card__image-skeleton {
    position: absolute;
    width: 148px;
    height: 148px;
    border-radius: 8px;
}

.ds-product-card.is-image-loaded .ds-product-card__image-skeleton {
    display: none;
}

.ds-product-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.ds-product-card__title {
    margin: 0;
}

.ds-product-card__title a {
    color: #0f172a;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ds-product-card__title a:hover {
    text-decoration: underline;
}

.ds-product-card--grid .ds-product-card__title a {
    -webkit-line-clamp: 2;
    min-height: 39px;
}

.ds-product-card--carousel .ds-product-card__title a {
    -webkit-line-clamp: 4;
    min-height: 78px;
}

.ds-price-block {
    display: grid;
    gap: 3px;
}

.ds-price-block__row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.ds-price-block__label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.ds-price-block__price {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    color: #0f172a;
}

.ds-price-block__meta {
    font-size: 12px;
    color: #64748b;
}

.ds-price-block__save {
    color: var(--savings-accent);
    font-size: 13px;
    font-weight: 700;
}

.ds-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ds-rating-stars__icons {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.ds-rating-stars__star {
    font-size: 13px;
    line-height: 1;
}

.ds-rating-stars__star--filled {
    color: var(--star-gold);
}

.ds-rating-stars__star--empty {
    color: var(--ui-border-color);
}

.ds-rating-stars__reviews {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.ds-product-card__cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--ui-border-color);
    border-radius: 999px;
    background: #f8fbff;
    color: #0f172a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.ds-product-card__cta:hover {
    background: #eef5ff;
}

.ds-product-carousel {
    position: relative;
    padding-inline: 28px;
}

.ds-product-carousel__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.ds-product-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.ds-product-carousel__track {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    gap: 32px;
}

.ds-product-carousel__item {
    width: 222px;
    min-width: 222px;
    flex: 0 0 222px;
    scroll-snap-align: start;
}

.ds-product-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 1px solid var(--ui-border-color);
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ds-product-carousel__arrow[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.ds-product-carousel__arrow--prev {
    left: 0;
}

.ds-product-carousel__arrow--next {
    right: 0;
}

.ds-product-carousel__dots {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.ds-product-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 0;
    background: var(--ui-border-color);
    cursor: pointer;
}

.ds-product-carousel__dot.is-active {
    background: #0f172a;
}

.ds-product-card a:focus-visible,
.ds-product-card button:focus-visible,
.ds-product-carousel button:focus-visible {
    outline: 3px solid var(--ui-focus-ring);
    outline-offset: 2px;
}

.ds-product-carousel:focus-visible {
    outline: 3px solid var(--ui-focus-ring);
    outline-offset: 4px;
}

.ds-skeleton {
    position: relative;
    overflow: hidden;
    background: #e9eff4;
}

.ds-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.66) 50%, rgba(255, 255, 255, 0) 100%);
    animation: ds-shimmer 1.2s infinite;
}

.ds-skeleton--pill {
    width: 72px;
    height: 18px;
    border-radius: 999px;
}

.ds-skeleton--image {
    width: 148px;
    height: 148px;
    border-radius: 8px;
}

.ds-skeleton--title {
    width: 100%;
    height: 14px;
    border-radius: 6px;
}

.ds-skeleton--title-short {
    width: 72%;
}

.ds-skeleton--price {
    width: 64%;
    height: 22px;
    border-radius: 8px;
}

.ds-skeleton--meta {
    width: 55%;
    height: 12px;
    border-radius: 6px;
}

.ds-skeleton--button {
    width: 128px;
    height: 36px;
    border-radius: 999px;
    margin-top: auto;
}

@keyframes ds-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 1023.98px) {
    .ds-product-carousel {
        padding-inline: 0;
    }

    .ds-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .ds-product-carousel__arrow {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .ds-product-card__image-shell {
        aspect-ratio: auto;
    }

    .ds-product-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ds-product-carousel__item {
        width: min(78vw, 280px);
        min-width: min(78vw, 280px);
        flex-basis: min(78vw, 280px);
    }

    .ds-product-carousel__track {
        gap: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ds-product-card__image,
    .ds-product-carousel__viewport,
    .ds-skeleton::after {
        transition: none;
        animation: none;
    }
}

/* ========================================
   Theme Unification Overrides
   ======================================== */
.ds-product-card,
.ds-product-card__sponsored,
.ds-product-card__cta,
.ds-product-carousel__arrow {
    background: var(--surface-2);
    border-color: var(--border-color);
}

.ds-product-card__title a,
.ds-price-block__price,
.ds-product-card__cta,
.ds-product-carousel__arrow {
    color: var(--text);
}

.ds-price-block__label,
.ds-price-block__meta,
.ds-rating-stars__reviews,
.ds-product-card__sponsored {
    color: var(--text-muted);
}

.ds-product-card__cta:hover,
.ds-product-carousel__arrow:hover {
    background: var(--surface);
}

.ds-skeleton {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.ds-skeleton::after {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        color-mix(in srgb, var(--surface-2) 65%, #ffffff) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}

html[data-theme="dark"] .ds-skeleton::after {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}
