/* Canonical product-card appearance. Page layouts own grid/carousel widths. */
.market-product-card {--card-blue:var(--market-header-logo-blue,#37a1c5);display:block;min-width:0;overflow:hidden;border:0;border-radius:8px;background:#fff;color:#1a2535;box-shadow:none;font-family:inherit;}
.market-product-card *, .market-product-card *::before, .market-product-card *::after {box-sizing:border-box;}
.mpc-media {position:relative;aspect-ratio:1.68;overflow:hidden;}
/* Separate white photos from the card text without changing gallery dimensions. */
.mpc-media::after {content:"";position:absolute;inset-inline:0;bottom:0;height:1px;background:var(--market-section-background,rgb(233 244 251 / 65%));pointer-events:none;z-index:2;}
.mpc-image {display:block;width:100%;height:100%;overflow:hidden;touch-action:pan-y;}
.mpc-image img {display:block;width:100%;height:100%;object-fit:cover;user-select:none;}
.mpc-heart {position:absolute;top:8px;right:8px;z-index:3;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border:0;border-radius:50%;padding:0;background:#fff;color:#68717b;cursor:pointer;}
.mpc-heart i {display:flex;align-items:center;justify-content:center;font-size:19px;line-height:1;margin:0;padding:0;}
.mpc-body {display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:20px 22px;gap:5px 8px;height:68px;padding:8px 10px;text-align:start;}
.mpc-name {grid-area:1/1;min-width:0;overflow:hidden;white-space:nowrap;margin:0;text-align:center;color:#1a2535;text-decoration:none;line-height:20px;}
.mpc-name>span {display:inline-block;font-size:13px;font-weight:700;white-space:nowrap;will-change:transform;}
/* Overflowing titles use a two-copy track; short titles remain centered. */
.mpc-name.mpc-scrolling {direction:ltr;text-align:left;}
.mpc-name.mpc-scrolling>span {display:inline-flex;direction:ltr;}
.mpc-title-copy {flex:0 0 auto;padding-inline-end:24px;}
.mpc-rating {grid-area:1/2;display:flex;align-items:center;justify-content:center;gap:2px;min-width:72px;font-size:12px;white-space:nowrap;color:#222;}
.mpc-rating i {color:#ffb300;}
.mpc-rating.mpc-unrated,.mpc-rating.mpc-unrated i {color:#8a96a8;font-size:11px;}
.mpc-description {grid-area:2/1;min-width:0;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;color:#68717b;line-height:22px;text-align:start;unicode-bidi:plaintext;}
.mpc-price {grid-area:2/2;align-self:center;justify-self:end;text-align:end;white-space:nowrap;font-size:13px;font-weight:700;color:var(--card-blue);line-height:22px;}
.mpc-ribbon {position:absolute;top:0;left:0;width:60px;height:60px;overflow:hidden;z-index:2;pointer-events:none;}
.mpc-ribbon[hidden] {display:none;}
.mpc-ribbon span {position:absolute;display:block;top:12px;left:-40px;width:120px;padding:3px 0;background:var(--card-blue);color:#fff;font-size:11px;font-weight:700;line-height:1.5;text-align:center;transform:rotate(-45deg);}
.market-product-card .card-image-gallery {width:100%;height:100%;overflow:hidden;touch-action:pan-y;}
.market-product-card .card-image-track {display:flex;width:100%;height:100%;will-change:transform;}
.market-product-card .card-image-slide {flex:0 0 100%;width:100%;height:100%;overflow:hidden;}
.market-product-card .card-gallery-dots {position:absolute;bottom:8px;left:50%;transform:translateX(-50%);display:flex;gap:6px;pointer-events:none;}
.market-product-card .card-gallery-dots span {width:6px;height:6px;border-radius:999px;background:rgba(160,170,180,.7);transition:width .3s ease-out,background-color .3s ease-out;}
.market-product-card .card-gallery-dots .active {width:16px;background:var(--card-blue);box-shadow:0 1px 6px #37a1c552;}
.market-product-card .card-gallery-dots [hidden] {display:none;}
.market-product-card a:focus-visible,.mpc-heart:focus-visible {outline:2px solid var(--card-blue);outline-offset:-2px;}
/* The approved card is landscape; narrow two-column grids switch to one. */
@media(max-width:575px){.product-grid:has(>.market-product-card),.up-products-grid:has(>.market-product-card),.fv-grid:has(>.market-product-card){grid-template-columns:minmax(0,1fr);}}


/* Shared carousel card width; containers determine how many cards are visible. */
.mpc-carousel>.swiper-wrapper>.swiper-slide {width:330px;flex-shrink:0;}
@media(max-width:575px){.mpc-carousel>.swiper-wrapper>.swiper-slide {width:calc((100% - 12px)/1.2);}}

.mpc-description.mpc-description-short {text-align:center;}

.market-store-card .mpc-description {grid-column:1 / -1;}

.mpc-store-status {grid-area:2/2;align-self:center;justify-self:end;white-space:nowrap;font-size:9.75px;font-weight:700;line-height:22px;color:var(--card-blue);}
.mpc-store-status.mpc-store-closed {color:#8a96a8;}
.mpc-store-status[hidden] {display:none;}
.market-store-card:has(.mpc-store-status:not([hidden])) .mpc-description {grid-column:1;}

/* The reference card uses the same divider color as the similar-stores heading. */
:root { --catalog-card-divider: rgba(15, 23, 42, .08); }
.market-product-card {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid var(--catalog-card-divider);
}
.store-detail-similar .sim-stores-heading {
    border-block-end-color: var(--catalog-card-divider);
}
.market-store-card .mpc-store-status { font-size: 12px; }

/* Give the product and similar-store carousels the same inner gutters. */
.store-detail-similar #sim-stores-swiper {
    width: calc(100% - 32px);
    margin-inline: auto;
}

/* Match the shared Swiper breakpoints before the script initializes. */
:is(#storeProductsSwiper, #sim-stores-swiper, #pdSimilarSwiper, .sooq-products-swiper, .sooq-stores-swiper-paged):not(.swiper-initialized) > .swiper-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
}
:is(#storeProductsSwiper, #sim-stores-swiper, #pdSimilarSwiper, .sooq-products-swiper, .sooq-stores-swiper-paged):not(.swiper-initialized) > .swiper-wrapper > .swiper-slide {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    margin-inline: 0;
}
@media (min-width: 400px) {
    :is(#storeProductsSwiper, #sim-stores-swiper, #pdSimilarSwiper, .sooq-products-swiper, .sooq-stores-swiper-paged):not(.swiper-initialized) > .swiper-wrapper > .swiper-slide {
        width: calc((100% - 24px) / 2);
    }
}
@media (min-width: 992px) {
    :is(#storeProductsSwiper, #sim-stores-swiper, #pdSimilarSwiper, .sooq-products-swiper, .sooq-stores-swiper-paged):not(.swiper-initialized) > .swiper-wrapper > .swiper-slide {
        width: calc((100% - 48px) / 3);
    }
}

.market-product-card .mpc-body,
.market-product-card .mpc-name {
    background-color: #fff;
}
