/**
 * MBM Gallery Popup + Card Hover
 * Exact match to myinvitation popup structure.
 * Version: 4.0.0
 */

/* ═══════════════════════════════════════════════════════════
   0. PRODUCT BUILDER CTA – bottom of every product card
   ═══════════════════════════════════════════════════════════ */

a.product-builder-btn,
.product-builder-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0.75rem auto 0 !important;
    padding: 11px 26px !important;
    padding-top: 11px !important;
    background: #DD9D4C;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(221, 157, 76, 0.25);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    position: static !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    line-height: 1.4;
    text-transform: none;
}

a.product-builder-btn:hover,
a.product-builder-btn:focus,
.product-builder-btn:hover,
.product-builder-btn:focus {
    background: #DD9D4C;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(221, 157, 76, 0.35);
}
/* Hide the legacy mobile-only "Use This Biodata" button on desktop
   (existing CSS only targets <a>; we also output <button>). */
@media (min-width: 768px) {
    button.creat-btn-mobile {
        display: none !important;
    }
}

/* Hide the legacy mobile <button class="creat-btn-mobile"> everywhere —
   replaced by .product-builder-btn. The legacy <a class="creat-btn-mobile">
   used elsewhere is untouched. */
button.creat-btn-mobile {
    display: none !important;
}


/* ═══════════════════════════════════════════════════════════
   1. CARD HOVER – product list / WooCommerce loop
   ═══════════════════════════════════════════════════════════ */

.template-hover-buttons {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.40);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 2;
    border-radius: 4px;
}

.template-image-wrapper:hover .template-hover-buttons {
    opacity: 1;
}

.hover-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 26px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hover-btn--edit {
    background: #DD9D4C;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.hover-btn--edit:hover {
    background: #fff;
    color: #1a1a2e;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   2. GALLERY POPUP OVERLAY — exact match to myinvitation
   ═══════════════════════════════════════════════════════════ */

.product-gallery-popup-wrapper.gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.60);
    z-index: 99999;
    overflow-y: auto;
    padding: 40px 0;
    border: none;
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
}

body.hide-scroll {
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   3. ROW CONTAINER — exact match to myinvitation
   ═══════════════════════════════════════════════════════════ */

.product-gallery-popup-wrapper .row-container {
    display: flex;
    align-items: flex-start;
    position: absolute;
    top: 50%;
    left: 5%;
    width: calc(100% - 10%);
    background: #fff;
    transform: translateY(-50%);
    padding: 80px 30px;
    border-radius: 10px;
}

.row-container .close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #000;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    font-size: 18px;
    color: #000;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.row-container .close-popup:hover {
    background: #000;
    color: #fff;
}

.gallery-popup-share-btn {
    position: absolute;
    top: 1rem;
    right: calc(1rem + 30px);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #DD9D4C;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #fff;
    color: #DD9D4C;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.2s ease;
}

.gallery-popup-share-btn svg {
    display: block;
    width: 12px;
    height: 12px;
}

.gallery-popup-share-btn:hover,
.gallery-popup-share-btn:focus {
    background: #DD9D4C;
    color: #fff;
    transform: scale(1.1);
    outline: none;
}

/* ═══════════════════════════════════════════════════════════
   4. IMAGE CONTAINER (left 60%)
   ═══════════════════════════════════════════════════════════ */

.image-container {
    width: 60%;
    flex-shrink: 0;
}

ul.products li.product .product-gallery-popup-wrapper img,
.product-gallery-popup-wrapper img {
    max-height: 420px;
    min-height: unset;
    transform: scale(1) !important;
    width: 100%;
    object-fit: contain;
}

/* Vanilla slider — 1 image at a time (matches myinvitation owl items:1) */
.mbm-popup-slider {
    position: relative;
    overflow: hidden;
}

.mbm-slider-track {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    transition: transform 0.35s ease;
    will-change: transform;
}

.mbm-slide {
    flex: 0 0 33.333%;
    width: 33.333%;
    box-sizing: border-box;
    padding: 0 5px;
}

.mbm-slide a {
    display: block;
}

.mbm-slide img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    display: block;
}

.mbm-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.90);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    transition: background 0.15s ease;
    z-index: 3;
}

.mbm-slider-btn:hover { background: #fff; }
.mbm-slider-btn--prev { left: 8px; }
.mbm-slider-btn--next { right: 8px; }

/* Dots — exact match to myinvitation .image-container .owl-dots */
.mbm-slider-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding-top: 10px;
    text-align: center;
}

.mbm-dot {
    border-radius: 50%;
    width: 10px;
    height: 10px;
    background-color: #f2f2f2;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, width 0.2s ease, border-radius 0.2s ease;
    display: inline-block;
}

.mbm-dot.active {
    background-color: #BFBFBF;
    width: 35px;
    border-radius: 5px;
}

/* ═══════════════════════════════════════════════════════════
   5. CONTENT CONTAINER (right 40%) — exact match to myinvitation
   ═══════════════════════════════════════════════════════════ */

.content-container {
    width: 40%;
    padding-left: 10px;
}

.popup-product-title {
    display: block;
    font-size: 22px;
    font-weight: 600;
    color: #000;
    margin-bottom: 12px;
    line-height: 1.3;
}

.popup-product-title a {
    color: inherit;
    text-decoration: none;
}

.content-container ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px;
}

.content-container ul li {
    display: flex;
    font-size: 14px;
    color: #313131;
    margin-bottom: 5px;
}

.content-container ul li svg {
    margin-right: 5px;
    flex-shrink: 0;
}

.live-counter {
    font-size: 16px;
    font-weight: 400;
    color: black;
    margin-top: 10px;
    margin-bottom: 25px;
}

.biodataCounter {
    color: #4e9459;
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Buttons — two separate .button_section divs, pink rounded pill */
.button_section {
    display: inline-block;
    margin-bottom: 12px;
    margin-right: 8px;
}

.button_section a,
.popup-edit-button {
    border-radius: 200px;
    background: #DD9D4C;
    color: #fff;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 30px;
    display: inline-block;
    border: 1px solid #DD9D4C;
    outline: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.button_section a:hover,
.button_section a:focus,
.popup-edit-button:hover,
.popup-edit-button:focus {
    color: #000;
    background: transparent;
    border-color: #000;
    text-decoration: none;
}

ul.products li.product .product-gallery-popup-wrapper .button_section a, .product-gallery-popup-wrapper.gallery-popup .content-container a.popup-edit-button {
    color: #fff;
}
ul.products li.product .product-gallery-popup-wrapper .button_section a:hover,
ul.products li.product .product-gallery-popup-wrapper .button_section a:focus, 
.product-gallery-popup-wrapper.gallery-popup .content-container a.popup-edit-button:hover,
.product-gallery-popup-wrapper.gallery-popup .content-container a.popup-edit-button:focus {
    color: #000;
}

.product-gallery-popup-wrapper.gallery-popup .content-container a {
    text-decoration: none;
    color: #000;
}

/* ═══════════════════════════════════════════════════════════
   6. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media screen and (max-width: 1024px) {
    .mbm-slide {
        flex: 0 0 50%;
        width: 50%;
    }
}

@media screen and (max-width: 576px) {
    .mbm-slide {
        flex: 0 0 100%;
        width: 100%;
    }
}

@media screen and (max-width: 991px) {
    .image-container,
    .content-container {
        width: 100%;
        padding: 0;
    }
    .content-container {
        padding: 0 30px;
    }
    .product-gallery-popup-wrapper .row-container{
        display: block;
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        transform: none;
        padding: 50px 20px 40px;
    }
    .product-gallery-popup-wrapper.gallery-popup{
        padding: 30px;
    }
}

@media screen and (max-width: 576px) {
    .product-gallery-popup-wrapper.gallery-popup {
        padding: 30px 10px 50px;
    }
    .content-container {
        text-align: left;
        padding: 0 15px;
    }
    .popup-product-title {
        font-size: 16px;
    }
    .button_section a,
    .popup-edit-button {
        font-size: 14px;
        padding: 12px 20px;
    }
    .mbm-slider-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    .mbm-slide img {
        min-height: 200px;
    }
}

/* ═══════════════════════════════════════════════════════════
   7. COPY-LINK TOAST
   ═══════════════════════════════════════════════════════════ */

.mbm-copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a2e;
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.mbm-copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
