/* Shared dashboard/catalog cards and product discovery rails. */
.product-discovery-rails { margin-top: 36px; min-width: 0; }
.product-discovery-rails .products-carousel-wrapper { position: relative; padding: 0; overflow: hidden; }
.product-discovery-rails .products-carousel { display: flex; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; user-select: none; -webkit-overflow-scrolling: touch; }
.product-discovery-rails .products-carousel::-webkit-scrollbar { display: none; }
.product-discovery-rails .view-all-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.product-discovery-rails .discovery-empty { margin: 0; padding: 20px 0; color: var(--pb-muted); font-size: 14px; }
/* Product discovery rails */
html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-list {
    margin: clamp(22px, 3vw, 34px) 0;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-divider {
    height: 0;
    margin: clamp(28px, 4vw, 44px) 0;
    border: 0;
    border-top: 1px solid var(--pb-border-strong);
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px !important;
    padding-bottom: 0;
    border-bottom: 0 !important;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .category-heading-group {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 13px;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .category-icon {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(var(--pb-primary-rgb), 0.18);
    border-radius: 13px;
    background: var(--pb-primary-soft);
    color: var(--pb-primary);
    font-size: 21px;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--pb-primary);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.11em;
    line-height: 1.2;
    text-transform: uppercase;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .category-title {
    min-width: 0;
    margin: 0 !important;
    overflow: hidden;
    color: var(--pb-heading) !important;
    font-size: clamp(19px, 2vw, 26px) !important;
    font-weight: 800 !important;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .category-actions,
html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .carousel-controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 9px;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .carousel-control {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--pb-border-strong);
    border-radius: 10px;
    background: var(--pb-surface-soft);
    color: var(--pb-heading);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .carousel-control:hover:not(:disabled) {
    border-color: var(--pb-primary);
    background: var(--pb-primary-soft);
    color: var(--pb-primary);
    transform: translateY(-1px);
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .carousel-control:focus-visible {
    outline: 0;
    box-shadow: var(--pb-ring);
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .carousel-control:disabled {
    cursor: default;
    opacity: 0.38;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .view-all-link {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(var(--pb-primary-rgb), 0.16);
    border-radius: 10px;
    background: var(--pb-primary-soft) !important;
    color: var(--pb-primary) !important;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .view-all-link:hover {
    border-color: rgba(var(--pb-primary-rgb), 0.36);
    transform: translateY(-1px) !important;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .products-carousel-wrapper {
    overflow: visible;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .products-carousel {
    gap: 16px !important;
    padding: 8px 2px 24px;
    scroll-behavior: smooth;
    scroll-padding-inline: 2px;
    scroll-snap-type: x proximity;
    cursor: grab;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .products-carousel:focus-visible {
    outline: 0;
    box-shadow: var(--pb-ring);
    border-radius: 16px;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .products-carousel.active {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-card,
html[data-site-theme="blue"] .catalog-products .products-grid .product-card {
    flex: 0 0 clamp(244px, 21.5vw, 286px);
    min-width: 0 !important;
    max-width: 286px !important;
    padding: 0 !important;
    overflow: hidden;
    scroll-snap-align: start;
    border: 1px solid var(--pb-border) !important;
    border-radius: 17px !important;
    background: var(--pb-surface-raised) !important;
    box-shadow: var(--pb-shadow-sm) !important;
    transform: none;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-card:hover,
html[data-site-theme="blue"] .catalog-products .products-grid .product-card:hover {
    border-color: var(--pb-border-strong) !important;
    box-shadow: var(--pb-shadow-md) !important;
    transform: translateY(-4px) !important;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-image,
html[data-site-theme="blue"] .catalog-products .products-grid .product-image {
    display: grid;
    place-items: center;
    height: 210px;
    margin: 0 !important;
    padding: 14px;
    border-bottom: 1px solid var(--pb-divider);
    background: var(--pb-media-surface) !important;
    overflow: hidden;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-image img,
html[data-site-theme="blue"] .catalog-products .products-grid .product-image img {
    width: 100% !important;
    height: 180px !important;
    max-width: 100%;
    max-height: 180px;
    border-radius: 10px;
    object-fit: contain;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .product-image-placeholder,
html[data-site-theme="blue"] .catalog-products .products-grid .product-image-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: var(--pb-surface-soft);
    color: var(--pb-subtle);
    font-size: 40px;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .discount-badge,
html[data-site-theme="blue"] .catalog-products .products-grid .discount-badge {
    top: 12px;
    left: 12px;
    min-height: 28px;
    padding: 6px 9px;
    border: 1px solid var(--pb-danger);
    border-radius: 8px !important;
    background: var(--pb-danger) !important;
    color: var(--pb-on-primary) !important;
    box-shadow: 0 7px 16px rgba(var(--pb-danger-rgb), 0.28);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.04em;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-info,
html[data-site-theme="blue"] .catalog-products .products-grid .product-info {
    min-height: 208px;
    padding: 18px !important;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-title,
html[data-site-theme="blue"] .catalog-products .products-grid .product-title {
    min-height: 44px;
    margin: 0 0 14px !important;
    color: var(--pb-heading) !important;
    font-size: 13px !important;
    font-weight: 750 !important;
    line-height: 1.55 !important;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-title a,
html[data-site-theme="blue"] .catalog-products .products-grid .product-title a {
    color: inherit;
    text-decoration: none;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-title a:hover,
html[data-site-theme="blue"] .catalog-products .products-grid .product-title a:hover {
    color: var(--pb-primary);
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-price,
html[data-site-theme="blue"] .catalog-products .products-grid .product-price {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    min-height: 47px;
    margin: 0 0 16px !important;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .price-left,
html[data-site-theme="blue"] .catalog-products .products-grid .price-left {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 2px;
    min-width: 0;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .price-label,
html[data-site-theme="blue"] .catalog-products .products-grid .price-label {
    flex-basis: 100%;
    color: var(--pb-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

:is(body.home-page, .product-discovery-rails) .home-category-section .price-checked-at,
.catalog-products .products-grid .price-checked-at {
    flex-basis: 100%;
    color: var(--pb-muted);
    font-size: 10px;
    line-height: 1.4;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .current-price,
html[data-site-theme="blue"] .catalog-products .products-grid .current-price {
    color: var(--pb-positive) !important;
    font-size: 21px !important;
    font-weight: 850 !important;
    letter-spacing: -0.035em;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .highest-price,
html[data-site-theme="blue"] .catalog-products .products-grid .highest-price {
    color: var(--pb-subtle);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    white-space: nowrap;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .tracking-badge,
html[data-site-theme="blue"] .catalog-products .products-grid .tracking-badge {
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid rgba(var(--pb-primary-rgb), 0.15);
    border-radius: 9px;
    background: var(--pb-primary-soft) !important;
    color: var(--pb-primary) !important;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-price-meta,
html[data-site-theme="blue"] .catalog-products .products-grid .home-price-meta {
    display: flex;
    align-items: center;
    gap: 4px;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-price-meta .tracking-badge,
html[data-site-theme="blue"] .catalog-products .products-grid .home-price-meta .tracking-badge {
    gap: 3px;
    padding: 4px 5px;
    font-size: 10px;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .product-price:has(.tracking-badge) .current-price,
html[data-site-theme="blue"] .catalog-products .products-grid .product-price:has(.tracking-badge) .current-price {
    font-size: 19px !important;
}

/* Static mobile-style badge at 80% of the original size. */
:is(body.home-page, .product-discovery-rails) .home-deal-score,
.catalog-products .products-grid .home-deal-score {
    position: relative;
    display: block;
    flex: 0 0 44.8px;
    width: 44.8px;
    height: 36.8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pb-primary);
    font: inherit;
    cursor: default;
}

:is(body.home-page, .product-discovery-rails) .home-score-arc,
.catalog-products .products-grid .home-score-arc {
    position: absolute;
    top: 1.96px;
    left: 3.36px;
    width: 38.08px;
    height: 27.2px;
    background: conic-gradient(from 245deg at 50% 70%, rgb(255, 59, 59) 0deg, rgb(255, 159, 67) 57.5deg, rgb(251, 191, 36) 115deg, rgb(163, 230, 53) 172.5deg, rgb(46, 204, 113) 230deg, transparent 230deg);
    -webkit-mask: url('../icons/deal-score-arc.svg') center / contain no-repeat;
    mask: url('../icons/deal-score-arc.svg') center / contain no-repeat;
}

:is(body.home-page, .product-discovery-rails) .home-deal-score.is-unavailable .home-score-arc,
.catalog-products .products-grid .home-deal-score.is-unavailable .home-score-arc {
    background: rgb(156, 163, 175);
}

:is(body.home-page, .product-discovery-rails) .home-score-value,
.catalog-products .products-grid .home-score-value {
    position: absolute;
    top: 13.6px;
    left: 0;
    right: 0;
    color: var(--home-score-color, var(--pb-muted));
    font-size: 12.24px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

:is(body.home-page, .product-discovery-rails) .home-score-label,
.catalog-products .products-grid .home-score-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: var(--pb-primary);
    font-size: 8.8px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-actions,
html[data-site-theme="blue"] .catalog-products .products-grid .product-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-top: auto;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section :is(.btn-view-details, .btn-buy-now),
html[data-site-theme="blue"] .catalog-products .products-grid :is(.btn-view-details, .btn-buy-now) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px !important;
    box-shadow: none !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .btn-view-details:hover,
html[data-site-theme="blue"] .catalog-products .products-grid .btn-view-details:hover {
    border-color: var(--pb-primary) !important;
    background: var(--pb-primary-soft) !important;
    color: var(--pb-primary) !important;
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .btn-buy-now:hover,
html[data-site-theme="blue"] .catalog-products .products-grid .btn-buy-now:hover {
    filter: brightness(1.06);
}

html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section :is(.btn-view-details, .btn-buy-now):focus-visible,
html[data-site-theme="blue"] .catalog-products .products-grid :is(.btn-view-details, .btn-buy-now):focus-visible {
    outline: 0;
    box-shadow: var(--pb-ring) !important;
}


@media (max-width: 760px) {
    html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .category-header { align-items: flex-start; flex-direction: column; gap: 16px; }
    html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .category-actions { justify-content: space-between; width: 100%; }
    html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .category-title { white-space: normal; }
    html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .home-category-section .product-card { flex-basis: min(80vw, 276px); }
}
@media (max-width: 540px) {
    html[data-site-theme="blue"] :is(body.home-page, .product-discovery-rails) .carousel-control[data-carousel-direction] { display: none; }
}
.product-discovery-rails .products-carousel.is-looping { scroll-behavior: auto !important; scroll-snap-type: none !important; overflow-anchor: none; }
.product-discovery-rails .products-carousel.is-looping > .product-card { scroll-snap-align: none !important; }

/* Keep small card labels readable on dark surfaces and bright badges. */
html[data-site-theme="blue"][data-theme-mode="dark"] :is(body.home-page, .product-discovery-rails) .view-all-link {
    color: var(--pb-link) !important;
}
html[data-site-theme="blue"][data-theme-mode="dark"] :is(body.home-page, .product-discovery-rails) .home-category-section .discount-badge,
html[data-site-theme="blue"][data-theme-mode="dark"] .catalog-products .products-grid .discount-badge {
    color: var(--pb-on-bright) !important;
}
html[data-site-theme="blue"][data-theme-mode="dark"] :is(body.home-page, .product-discovery-rails) .home-category-section .highest-price,
html[data-site-theme="blue"][data-theme-mode="dark"] .catalog-products .products-grid .highest-price {
    color: var(--pb-muted);
}

/* Shared light cards need the same small-text contrast as product details. */
html[data-site-theme="blue"][data-theme-mode="light"] :is(body.home-page, .product-discovery-rails) .view-all-link {
    color: #0047c7 !important;
}
html[data-site-theme="blue"][data-theme-mode="light"] :is(body.home-page, .product-discovery-rails) .home-category-section .discount-badge,
html[data-site-theme="blue"][data-theme-mode="light"] .catalog-products .products-grid .discount-badge {
    background: #be123c !important;
    border-color: #be123c;
}
html[data-site-theme="blue"][data-theme-mode="light"] :is(body.home-page, .product-discovery-rails) .home-category-section .highest-price,
html[data-site-theme="blue"][data-theme-mode="light"] .catalog-products .products-grid .highest-price {
    color: var(--pb-muted);
}

/* Match the catalog card skin without changing homepage carousel widths. */
html[data-site-theme="blue"] body.home-page .home-category-section .product-card {
    container: homepage-card / inline-size;
    border-radius: 22px !important;
    background: var(--pb-surface) !important;
    box-shadow: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    will-change: auto;
}
html[data-site-theme="blue"] body.home-page .home-category-section .product-card:hover {
    border-color: var(--pb-border-strong) !important;
    box-shadow: none !important;
    transform: none !important;
}
html[data-site-theme="blue"] body.home-page .home-category-section .product-image { height: 210px; padding: 20px; }
html[data-site-theme="blue"] body.home-page .home-category-section .product-image img { height: 170px !important; max-height: 170px; border-radius: 0; }
html[data-site-theme="blue"] body.home-page .home-category-section .product-info { min-height: 212px; padding: 18px !important; }
html[data-site-theme="blue"] body.home-page .home-category-section .product-title { font-weight: 650 !important; letter-spacing: -.015em; }
html[data-site-theme="blue"] body.home-page .home-category-section .current-price { color: var(--pb-heading) !important; }
html[data-site-theme="blue"] body.home-page .home-category-section .price-label { font-size: 8px; letter-spacing: .11em; font-weight: 650; }
html[data-site-theme="blue"]:is([data-theme-mode="light"], [data-theme-mode="dark"]) body.home-page .home-category-section .discount-badge {
    top: 12px;
    left: 12px;
    min-height: 25px;
    padding: 5px 9px;
    border: 1px solid var(--pb-positive-soft);
    border-radius: 100px !important;
    background: var(--pb-positive-soft) !important;
    color: var(--pb-positive) !important;
    box-shadow: none;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .025em;
}
html[data-site-theme="blue"] body.home-page .home-category-section :is(.btn-view-details, .btn-buy-now) {
    min-height: 38px;
    border-radius: 100px !important;
    font-weight: 700 !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    backface-visibility: visible;
}
html[data-site-theme="blue"] body.home-page .home-category-section .btn-view-details { border-color: var(--pb-border-strong); background: var(--pb-surface-soft); color: var(--pb-heading); }
html[data-site-theme="blue"] body.home-page .home-category-section .btn-buy-now { border: 1px solid var(--pb-primary); background: var(--pb-primary); color: var(--pb-on-primary); }
html[data-site-theme="blue"] body.home-page .home-category-section .btn-buy-now:hover { border-color: var(--pb-primary-hover); background: var(--pb-primary-hover); filter: none; }
html[data-site-theme="blue"] body.home-page .home-category-section .product-card,
html[data-site-theme="blue"] body.home-page .home-category-section .product-card *,
html[data-site-theme="blue"] body.home-page .home-category-section .product-card *::before,
html[data-site-theme="blue"] body.home-page .home-category-section .product-card *::after { animation: none !important; transition: none !important; }
html[data-site-theme="blue"] body.home-page .home-category-section .product-card:hover :is(.product-image, .product-image img, .product-title, .btn-view-details, .btn-buy-now) { transform: none !important; }

@media (max-width: 768px) {
    html[data-site-theme="blue"] body.home-page .home-category-section .product-image { height: auto; aspect-ratio: 1; padding: 12px; }
    html[data-site-theme="blue"] body.home-page .home-category-section .product-image img { height: 100% !important; max-height: 100%; min-height: 0; }
    html[data-site-theme="blue"] body.home-page .home-category-section .product-info { min-height: 194px; }
}
@media (max-width: 540px) {
    html[data-site-theme="blue"] body.home-page .home-category-section .product-card { border-radius: 17px !important; }
    html[data-site-theme="blue"]:is([data-theme-mode="light"], [data-theme-mode="dark"]) body.home-page .home-category-section .discount-badge { top: 9px; left: 9px; padding: 4px 7px; min-height: 22px; font-size: 8px; }
}
@container homepage-card (max-width: 240px) {
    html[data-site-theme="blue"] body.home-page .home-category-section .product-info { padding: 12px !important; }
    html[data-site-theme="blue"] body.home-page .home-category-section .product-title { font-size: 12px !important; }
    html[data-site-theme="blue"] body.home-page .home-category-section .product-price { column-gap: 4px; }
    html[data-site-theme="blue"] body.home-page .home-category-section .current-price { font-size: clamp(12px, 8cqi, 18px) !important; }
    html[data-site-theme="blue"] body.home-page .home-category-section :is(.btn-view-details, .btn-buy-now) { gap: 4px; padding: 8px 4px; font-size: 9px !important; line-height: 1.3; white-space: normal; text-align: center; }
}
@container homepage-card (max-width: 150px) {
    html[data-site-theme="blue"] body.home-page .home-category-section :is(.btn-view-details, .btn-buy-now) { gap: 2px; padding-inline: 2px; }
}
