/*
 * Theme-independent product collection primitives.
 *
 * The responsive column counts are supplied by ProductDisplayService through
 * the --pd-* custom properties, so no theme has to hardcode grid columns.
 */

/*
 * Global product image standard: every product card image area is a 3:4
 * portrait frame. Themes consume the shared product card, so this ratio
 * applies to every current and future theme automatically.
 */
.product-card__image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.product-card__image > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*
 * Storefront Taka symbol: keep it slightly larger and bolder than the amount.
 */
.product-card .currency-symbol {
    font-size: 1.08em;
    font-weight: 700;
}

.currency-symbol {
    font-size: 1.08em;
    font-weight: 700;
}

/*
 * Old-price strike-through: the Taka symbol and the amount use normal weight.
 * Font size, colour, line-through and spacing stay untouched. The dedicated
 * class keeps the current price and every other price display bold.
 */
.product-old-price,
.product-old-price .currency-symbol {
    font-weight: 400 !important;
}

/*
 * Global Product Details gallery standard: the main image/video frame and
 * every thumbnail use the same 3:4 portrait ratio. Theme styles may not
 * replace this ratio, so current and future themes inherit it automatically.
 */
#imageContainer,
#videoContainer,
.video-square {
    aspect-ratio: 3 / 4 !important;
}

.thumbnail-btn {
    aspect-ratio: 3 / 4 !important;
    height: auto !important;
}

.thumbnail-btn > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-display-grid {
    display: grid;
    grid-template-columns: repeat(var(--pd-mobile, 2), minmax(0, 1fr));
}

@media (min-width: 768px) {
    .product-display-grid {
        grid-template-columns: repeat(var(--pd-tablet, 3), minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .product-display-grid {
        grid-template-columns: repeat(var(--pd-desktop, 4), minmax(0, 1fr));
    }
}

.product-slider {
    position: relative;
}

.product-slider__viewport {
    overflow: hidden;
}

.product-slider__track {
    display: flex;
    transition: transform .5s ease;
    will-change: transform;
}

.product-slider__item {
    flex: 0 0 auto;
    min-width: 0;
}

.product-slider__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    transform: translateY(-50%);
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease;
}

.product-slider__nav:hover {
    opacity: .75;
}

.product-slider__nav:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.product-slider__nav--prev {
    left: -.75rem;
}

.product-slider__nav--next {
    right: -.75rem;
}

.product-slider__nav svg {
    width: 1.15rem;
    height: 1.15rem;
}

@media (prefers-reduced-motion: reduce) {
    .product-slider__track {
        transition: none;
    }
}
