/**
 * Frontend product images - contain within frame, professional scale
 */

/* Product card: single image in a fixed frame */
.product-card__thumb {
    overflow: hidden;
    position: relative;
    min-height: 200px;
}

.product-card__media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.product-card__media .product-card__img {
    display: block;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
}

/* Disable main.css scale(1.2) — it breaks card image layout */
.product-card .product-card__thumb .product-card__media .product-card__img,
.product-card:hover .product-card__thumb .product-card__media .product-card__img {
    transform: none !important;
    transition: none !important;
}

/* Product details page: main image & thumbnails - fixed frame, image inside only */
.product-details__thumb-slider .product-details__thumb {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 16px;
}

.product-details__thumb-slider .product-details__thumb img {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.product-details__images-slider .pdp-thumb-frame {
    width: 96px;
    height: 96px;
    margin: 0 auto;
    overflow: hidden;
    cursor: pointer;
}

.product-details__images-slider .pdp-thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-details__images-slider .slick-current .pdp-thumb-frame {
    border-color: var(--main-600, #043729) !important;
    box-shadow: 0 0 0 2px rgba(4, 55, 41, 0.12);
}

.product-details__images-slider .product-details__thumb,
.product-details__images-slider .flex-center {
    overflow: hidden;
}

.product-details__images-slider img {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

/* Home deal week / banner product images */
.deal-week-box img[alt]:not([alt=""]),
.deal-week-box .banner-product-img,
.banner-item-two__thumb img {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

.deal-week-box .d-lg-block img {
    max-height: 200px;
}

/* Flash deals & promo banners */
.flash-sales-item__bg,
.promotional-banner img[src*="storage"] {
    object-fit: cover;
}

.promotional-banner .pe-xxl-2 img {
    object-fit: contain;
    max-width: 100%;
    max-height: 180px;
}

/* Home vendors logos */
.popular-products .product-card__media .product-card__img {
    object-fit: contain;
    max-width: 100%;
    max-height: 80px;
}

/* Shop grid: ensure all product card images respect the frame */
.shop .product-card__thumb,
.top-selling-products .product-card__thumb,
.deals-week-slider .product-card__thumb,
.new-arrival__slider .product-card__thumb,
.featured-product-slider .product-card__thumb,
.top-selling-product-slider .product-card__thumb,
.product-block-advanced-slider .product-card__thumb,
.our-products-slider .product-card__thumb,
.trending-products-slider .product-card__thumb,
.best-sellers-slider .product-card__thumb,
.hajj-umrah-slider .product-card__thumb {
    overflow: hidden;
}

.shop .product-card__media .product-card__img,
.top-selling-products .product-card__media .product-card__img,
.deals-week-slider .product-card__media .product-card__img,
.new-arrival__slider .product-card__media .product-card__img,
.featured-product-slider .product-card__media .product-card__img,
.top-selling-product-slider .product-card__media .product-card__img,
.product-block-advanced-slider .product-card__media .product-card__img,
.our-products-slider .product-card__media .product-card__img,
.trending-products-slider .product-card__media .product-card__img,
.best-sellers-slider .product-card__media .product-card__img,
.hajj-umrah-slider .product-card__media .product-card__img {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

@media screen and (max-width: 1199px) {
    .product-card__thumb {
        min-height: 180px;
    }
}

@media screen and (max-width: 575px) {
    .product-card__thumb {
        min-height: 160px;
    }
}

/* Quick-add Slick gallery (same pattern as PDP) */
.quick-add-gallery-root .quick-add-gallery__main.product-details__thumb-slider {
    padding: 12px 16px;
    min-height: 240px;
}

.quick-add-gallery-root .product-details__thumb {
    min-height: 220px;
    max-height: min(280px, 38vh);
    padding: 8px;
}

.quick-add-gallery-root .product-details__thumb img {
    width: 100%;
    height: 100%;
    max-height: min(260px, 36vh);
    object-fit: contain;
}

.quick-add-gallery-root .slick-initialized.slick-slider .slick-slide > div > div {
    height: 100%;
}

.quick-add-gallery-root .quick-add-gallery__nav .slick-slide {
    padding: 0 4px;
}

.quick-add-gallery-root .quick-add-gallery__nav .pdp-thumb-frame {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

.quick-add-gallery-root .quick-add-gallery__nav .pdp-thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.quick-add-gallery-root .quick-add-gallery__nav .slick-current .pdp-thumb-frame {
    border-color: var(--main-600, #043729) !important;
    box-shadow: 0 0 0 2px rgba(4, 55, 41, 0.12);
}

.quick-add-gallery-root .quick-add-gallery__nav .slick-track {
    display: flex;
    align-items: center;
}

@media screen and (max-width: 575px) {
    .quick-add-gallery-root .product-details__thumb {
        min-height: 200px;
        max-height: min(240px, 42vw);
    }

    .quick-add-gallery-root .quick-add-gallery__nav .pdp-thumb-frame {
        width: 56px;
        height: 56px;
    }
}

.quick-add-variant .pdp-size-btn {
    min-width: 44px;
}

/* Product card enhancements (excludes product-color-card / Product Block Advanced) */
.product-card:not(.product-color-card) .product-card__discount-tag {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-start: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(190, 18, 60, 0.32);
    pointer-events: none;
}

.product-card:not(.product-color-card) .product-card__discount-tag-value {
    display: block;
}

.product-card:not(.product-color-card) .product-card__flash-tag {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-end: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--main-600, #043729);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(4, 55, 41, 0.25);
    pointer-events: none;
    max-width: calc(100% - 24px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card:not(.product-color-card) .product-card__footer {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    overflow: visible;
    flex-wrap: nowrap;
}

.product-card:not(.product-color-card) .product-card__colors,
.product-card-mobile .product-card__colors {
    flex: 0 0 auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 6px;
    min-height: 22px;
}

.product-card-mobile__colors-row {
    min-height: 20px;
    margin-bottom: 8px;
}

.product-card-wrap {
    display: block;
    width: 100%;
    min-width: 0;
    height: 100%;
}

.product-card-mobile {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
    height: 100%;
    padding: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.product-card-mobile__header {
    display: block;
    width: 100%;
    flex: 0 0 auto;
}

.product-card-mobile__image {
    position: relative !important;
    display: block;
    width: 100%;
    height: 148px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.product-card-mobile__image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #fff;
}

.product-card-mobile__img {
    display: block;
    max-width: 92%;
    max-height: 92%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.product-card-mobile__img-placeholder {
    display: block;
    width: 72%;
    height: 72%;
    border-radius: 12px;
    background: #f9fafb;
}

.product-card-mobile__wishlist {
    position: absolute !important;
    top: 8px !important;
    inset-inline-end: 8px !important;
    inset-inline-start: auto !important;
    bottom: auto !important;
    z-index: 2;
}

.product-card-mobile__wishlist-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--main-600, #043729);
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(4, 55, 41, 0.28);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card-mobile__wishlist-btn:hover,
.product-card-mobile__wishlist-btn:focus-visible {
    color: #fff !important;
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(4, 55, 41, 0.35);
}

.product-card-mobile__wishlist-btn i {
    font-size: 1rem;
    line-height: 1;
    color: inherit !important;
}

.product-card-mobile__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    padding-top: 10px;
    min-width: 0;
}

.product-card-mobile__title {
    margin: 0 0 6px;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

.product-card-mobile__title .link {
    color: inherit !important;
    text-decoration: none !important;
}

.product-card-mobile__price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: auto;
}

.product-card-mobile__price-amount {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

.product-card-mobile__price-currency {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.product-card-mobile .product-card__colors {
    gap: 6px;
}

.product-card-mobile .product-card__color-dot {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
}

.product-card:not(.product-color-card) .product-card__color-dot,
.product-card-mobile .product-card__color-dot {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.18);
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    border-radius: 50%;
}

.product-card:not(.product-color-card) .product-card__color-dot--light,
.product-card-mobile .product-card__color-dot--light {
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.28);
}

.product-card:not(.product-color-card) .product-card__color-more,
.product-card-mobile .product-card__color-more {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.product-card:not(.product-color-card) .product-card__footer-actions {
    flex-shrink: 0;
}

.product-card:not(.product-color-card) .product-card__add-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--main-600, #043729);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 4px 14px rgba(4, 55, 41, 0.22);
}

.product-card:not(.product-color-card) .product-card__add-btn:hover,
.product-card:not(.product-color-card) .product-card__add-btn:focus-visible {
    background: var(--main-two-600, #065f46);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(4, 55, 41, 0.3);
}

.product-card:not(.product-color-card) .product-card__icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #4b5563;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.product-card:not(.product-color-card) .product-card__icon-btn:hover,
.product-card:not(.product-color-card) .product-card__icon-btn:focus-visible {
    border-color: var(--main-600, #043729);
    color: var(--main-600, #043729);
    background: #f9fafb;
}

.product-card:not(.product-color-card) .product-card__footer:not(:has(.product-card__colors)) {
    justify-content: flex-end;
}

@media (max-width: 991.98px) {
    .progress-wrap {
        display: none !important;
        pointer-events: none;
    }

    .list-grid-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        align-items: stretch;
    }

    .list-grid-wrapper > .product-card-wrap,
    .list-grid-wrapper .product-card-mobile,
    .trending-products-slider .slick-slide > div,
    .our-products-slider .slick-slide > div,
    .best-sellers-slider .slick-slide > div,
    .product-block-advanced-slider .slick-slide > div {
        height: 100%;
    }

    .trending-products-slider .product-card-mobile,
    .our-products-slider .product-card-mobile,
    .best-sellers-slider .product-card-mobile,
    .product-block-advanced-slider .product-card-mobile {
        margin-inline: 2px;
    }

    .list-view .product-card-mobile {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    .product-card-mobile .product-card__color-dot {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
        box-shadow: 0 0 0 1.5px rgba(17, 24, 39, 0.2);
    }
}
