/* ==========================================================================
   HockeySweaters - Print Preview Overlay
   Toont borstlogo (voorkant) en naam/nummer (achterkant) als overlay
   op de productafbeelding. De overlay wordt via wp_footer gerenderd
   en door JS verplaatst naar de juiste positie.
   ========================================================================== */

/* ─── Overlay container ─── */
.hs-print-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
    z-index: 100 !important;
    box-sizing: border-box;
}

/* ─── Borstlogo (linkerborst drager = rechts in beeld) ─── */
.hs-overlay-chest-logo {
    position: absolute;
    top: 27%;
    left: 54%;
    width: 12%;
    height: 12%;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hs-overlay-chest-logo.active {
    opacity: 1;
}

/* SVG en afbeeldingen in het borstlogo: vul de container */
.hs-overlay-chest-logo img,
.hs-overlay-chest-logo svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ─── Achterkant: naam + nummer overlay (bounding box) ─── */
.hs-overlay-back-text {
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;  /* JS schakelt naar 'flex' bij achterkant view */
    font-size: 5vw;
    line-height: 1.1;
    letter-spacing: 2px;
    box-sizing: border-box;
    overflow: hidden;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.hs-overlay-back-text.active {
    opacity: 1;
}

.hs-overlay-back-name {
    white-space: nowrap;
    max-width: 100%;
}

.hs-overlay-back-number {
    font-size: 1.4em;
    line-height: 1;
    margin-top: 2%;
}

/* ─── Voorkant / Achterkant toggle ─── */
/* Toggle zit IN de overlay, linksboven op de afbeelding.
   pointer-events: auto overschrijft de none van de parent overlay. */
.hs-view-toggle {
    display: flex;
    position: absolute;
    top: 8px;
    left: 8px;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.8);
    width: fit-content;
    pointer-events: auto;
    z-index: 110;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hs-view-btn {
    padding: 8px 18px;
    border: none;
    background: #fff;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hs-view-btn:first-child {
    border-right: 1px solid #e0e0e0;
}

.hs-view-btn:hover {
    background: #f5f5f5;
}

.hs-view-btn.active {
    background: #009ee0;
    color: #fff;
}

/* ─── Indicator badge ─── */
.hs-overlay-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hs-overlay-badge.active {
    opacity: 1;
}

/* ─── Achterkant placeholder (geen back image beschikbaar) ─── */
.hs-back-placeholder {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    z-index: 1;
}

/* ─── Zoom + lightbox uitschakelen ─── */
.woocommerce-product-gallery .zoomImg,
.woocommerce-product-gallery .woocommerce-product-gallery__trigger,
.zoomContainer,
.pswp {
    display: none !important;
}

/* Verwijder klik-cursor van productafbeelding link. */
.woocommerce-product-gallery__image > a {
    pointer-events: none;
    cursor: default;
}

.woocommerce-product-gallery__image > a > img {
    pointer-events: auto;
    cursor: default;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hs-overlay-chest-logo {
        top: 25%;
        left: 52%;
        width: 14%;
        height: 14%;
    }

    .hs-overlay-back-text {
        font-size: 4vw;
    }

    .hs-view-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
}
