/* =========================================================
   Goldau & Noelle Produktmasse Overlay
   =========================================================

   Enthaelt alle Styles fuer das Produktmasse-Overlay, den
   Produktmasse-Toggle, zugehoerige Responsive-Anpassungen
   und Animationen.
   ========================================================= */

/* ========================= 1. Overlay ========================= */

/* Ausgewaehlte Produktmasse als Overlay im Viewer */

/* Default */
.mkl_pc .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay {
    --gn-measure-length-line-x: 14.5;
    --gn-measure-length-line-y: 36;
    --gn-measure-length-line-length: 54;
    --gn-measure-length-line-angle: -3.5;
    --gn-measure-length-text-x: 44;
    --gn-measure-length-text-y: 32;

    --gn-measure-width-line-x: 71;
    --gn-measure-width-line-y: 32.7;
    --gn-measure-width-line-length: 16.5;
    --gn-measure-width-line-angle: 8;
    --gn-measure-width-text-x: 79.5;
    --gn-measure-width-text-y: 31.5;

    --gn-measure-height-line-x: 91;
    --gn-measure-height-line-y: 39;
    --gn-measure-height-line-length: 22.5;
    --gn-measure-height-line-angle: 90;
    --gn-measure-height-text-x: 88.5;
    --gn-measure-height-text-y: 50;

    --gn-measure-text-size: 2.5px;
    --gn-measure-text-change-start-size: 2.2px;
    --gn-measure-text-change-peak-size: 3.8px;

    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 24;
    pointer-events: none;
    color: #111;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/*  Spezifische Position der Produktmasse pro Produkt wird ueber die Klasse gn-measure-layout-*-* gesteuert. 
    Die entsprechenden CSS Anpassungen sind im child-theme unter gn-measurements-overlay.css vorzunehmen.
*/



.mkl_pc.gn-measurements-visible .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay {
    opacity: 1;
    transform: translateY(0);
}

.mkl_pc .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay__svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.mkl_pc .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay__item {
    opacity: 1;
    transition: opacity 0.18s ease;
}

.mkl_pc .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay__item.is-empty {
    opacity: 0;
}

.mkl_pc .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay__item line {
    fill: none;
    stroke: #aaa;
    stroke-width: 0.1;
    stroke-linecap: round;
    filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.75));
}

.mkl_pc .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay__item text {
    fill: currentColor;
    font-size: var(--gn-measure-text-size, 2.5px);
    font-weight: 400;
    text-anchor: middle;
    dominant-baseline: middle;
    transition: fill 0.18s ease;
}

.mkl_pc .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay__item text.is-changing {
    animation: gn-measurement-value-change 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    fill: #000;
}

/* ========================= 2. Toggle ========================= */

.mkl_pc .mkl_pc_container .gn-measurements-toggle {
    display: none;
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    margin: 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    color: #000;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.mkl_pc.gn-measurements-available .mkl_pc_container .gn-measurements-toggle {
    display: inline-flex;
}

.mkl_pc .mkl_pc_container .gn-measurements-toggle:hover,
.mkl_pc .mkl_pc_container .gn-measurements-toggle:focus-visible,
.mkl_pc.gn-measurements-visible .mkl_pc_container .gn-measurements-toggle {
    color: #fff;
    background: #000;
    box-shadow: none;
    outline: none;
}

.mkl_pc:not(.gn-measurements-visible) .mkl_pc_container .gn-measurements-toggle.gn-measurements-toggle-ignore-hover:hover {
    color: #000;
    background: rgba(255, 255, 255, 0.6);
}

.mkl_pc .mkl_pc_container .gn-measurements-toggle__icon {
    width: 16px;
    height: 16px;
}

.mkl_pc .mkl_pc_container .gn-measurements-toggle__icon path {
    fill: currentColor;
}

/* ========================= 3. Responsive Overrides ========================= */

@media (min-width: 990px) {
    .mkl_pc .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay {
        --gn-measure-text-size: 2px;
        --gn-measure-text-change-start-size: 1.8px;
        --gn-measure-text-change-peak-size: 3.1px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mkl_pc .mkl_pc_container .mkl_pc_viewer .gn-measurements-overlay__item text.is-changing {
        animation: none;
    }
}

/* ========================= 4. Animations ========================= */

@keyframes gn-measurement-value-change {
    0% {
        opacity: 0.25;
        font-size: var(--gn-measure-text-change-start-size, 2.2px);
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }

    38% {
        opacity: 1;
        font-size: var(--gn-measure-text-change-peak-size, 3.8px);
        filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.95));
    }

    100% {
        opacity: 1;
        font-size: var(--gn-measure-text-size, 2.5px);
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }
}
