/* ================================================================
   MAISON DRIÉA — PRODUCT GALLERY: HOVER ZOOM + LIGHTBOX
   + BREADCRUMBS
   Enqueued on is_product(), is_shop(), is_product_taxonomy()
================================================================ */

/* ── Hover zoom (desktop only) ───────────────────────────────── */
@media (min-width: 769px) {
    .gallery-item {
        overflow: hidden;
    }

    .gallery-zoom-trigger {
        display: block;
        cursor: zoom-in;
    }

    .gallery-item img {
        display: block;
        width: 100%;
        transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: transform;
    }

    .gallery-item:hover img {
        transform: scale(1.04);
    }
}

/* ── Lightbox overlay ────────────────────────────────────────── */
.md-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    cursor: zoom-out;
}

.md-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.md-lightbox__wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 88vw;
    max-height: 92vh;
    cursor: default;
}

.md-lightbox__img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.md-lightbox__img.is-loaded {
    opacity: 1;
}

/* Close button */
.md-lightbox__close {
    position: fixed;
    top: 22px;
    right: 30px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    padding: 10px;
    line-height: 1;
    transition: color 0.2s;
    z-index: 10001;
}
.md-lightbox__close:hover { color: #fff; }

/* Prev / Next */
.md-lightbox__prev,
.md-lightbox__next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 9px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    padding: 20px 18px;
    line-height: 1;
    transition: color 0.2s;
    z-index: 10001;
    user-select: none;
}
.md-lightbox__prev:hover,
.md-lightbox__next:hover { color: rgba(255, 255, 255, 0.85); }
.md-lightbox__prev { left: 18px; }
.md-lightbox__next { right: 18px; }

/* Hide arrows when only 1 image */
.md-lightbox[data-count="1"] .md-lightbox__prev,
.md-lightbox[data-count="1"] .md-lightbox__next { display: none; }

/* Safety net: hide lightbox on mobile (mobile gets single-product-mobile.php) */
@media (max-width: 768px) {
    .md-lightbox { display: none !important; }
}

/* ── Breadcrumbs ─────────────────────────────────────────────── */
.md-breadcrumbs {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.38);
    margin: 0;
    padding: 0;
    line-height: 1;
}

.md-breadcrumbs a {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s;
}
.md-breadcrumbs a:hover { color: #0a0a0a; }

/* Current crumb (Yoast: .breadcrumb_last; RankMath: last item) */
.md-breadcrumbs .breadcrumb_last,
.md-breadcrumbs span:not(:has(a)):last-of-type { color: #0a0a0a; }

/* Separator */
.md-breadcrumbs .breadcrumb_separator { color: rgba(0, 0, 0, 0.22); }

/* Archive: sits inside .shop-hero, above the eyebrow */
.shop-hero .md-breadcrumbs {
    display: block;
    margin-bottom: 10px;
}

/* Desktop product page: above the two-column grid */
.product-page > .md-breadcrumbs {
    display: block;
    padding: 18px 48px 0;
}

/* Mobile product page */
.mob-single-product .md-breadcrumbs {
    display: block;
    padding: 10px 20px 0;
    font-size: 9px;
    letter-spacing: 0.13em;
}

@media (max-width: 768px) {
    .product-page > .md-breadcrumbs { padding: 12px 20px 0; }
}
