/* Pro Slider UI - Maximum Enforcement */

.wapf-slider-mode {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

/* Hide ALL selectors and theme-specific checkbox replacements VERY aggressively */
.wapf-slider-mode input.wapf-input,
.wapf-slider-mode input[type="checkbox"],
.wapf-slider-mode input[type="radio"],
.wapf-slider-mode .wapf-input-label::before,
.wapf-slider-mode .wapf-input-label::after,
.wapf-slider-mode [class*="checkbox"]::before,
.wapf-slider-mode [class*="checkbox"]::after,
.wapf-slider-mode [class*="radio"]::before,
.wapf-slider-mode [class*="radio"]::after,
.wapf-slider-mode .wp-block-checkbox::before,
.wapf-slider-mode .wp-block-checkbox::after,
.wapf-slider-mode .wp-block-radio::before,
.wapf-slider-mode .wp-block-radio::after {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
    z-index: -100 !important;
    margin: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
}

/* Ensure the label itself doesn't have background/padding that makes it look like a checkbox */
.wapf-slider-mode .wapf-input-label {
    padding-left: 0 !important;
    margin-left: 0 !important;
    border: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    position: relative !important;
    box-shadow: none !important;
}

.wapf-slider-mode .wapf-label-text {
    margin-left: 0 !important;
    padding-left: 0 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
}

/* Option image – same visual size as text on all screens (em = scales with label font) */
.wapf-option-image {
    display: inline-block !important;
    width: 1.15em !important;
    height: 1.15em !important;
    margin-right: 0.4em !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
    overflow: hidden !important;
    border-radius: 3px !important;
    border: 1px solid #e0e0e0 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    font-size: inherit !important;
}
.wapf-option-image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    border: none !important;
    border-radius: 2px !important;
    vertical-align: top !important;
    pointer-events: none !important;
}
.wapf-option-image:hover {
    border-color: #0073aa !important;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2) !important;
}

/* Lightbox for option images – click to see larger */
.wapf-image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.wapf-image-lightbox.is-open {
    display: flex !important;
}
.wapf-image-lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.wapf-image-lightbox__content img {
    display: block;
    max-width: 85vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
}
.wapf-image-lightbox__close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    font-weight: 300;
}
.wapf-image-lightbox__close:hover {
    background: #f0f0f0;
    color: #000;
}

/* Stepper Box - High Alignment */
.wapf-qty-stepper {
    display: inline-flex !important;
    align-items: center !important;
    border: 1px solid #d1d1d1 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #fff !important;
    height: 36px !important;
    margin-right: 15px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    flex-shrink: 0 !important;
}

.wapf-qty-btn {
    width: 36px !important;
    height: 36px !important;
    background: #f7f7f7 !important;
    border: none !important;
    color: #333 !important;
    font-size: 22px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-shadow: none !important;
}

.wapf-qty-btn:hover {
    background: #efefef !important;
    color: #000 !important;
}

.wapf-qty-btn:active {
    background: #e5e5e5 !important;
}

.wapf-qty-stepper input.wapf-qty {
    width: 42px !important;
    height: 36px !important;
    border: none !important;
    border-left: 1px solid #d1d1d1 !important;
    border-right: 1px solid #d1d1d1 !important;
    text-align: center !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    -moz-appearance: textfield !important;
}

.wapf-qty-stepper input.wapf-qty::-webkit-outer-spin-button,
.wapf-qty-stepper input.wapf-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Indented customization box */
.wapf-custom-text-wrapper {
    width: 100% !important;
    margin-top: 12px !important;
    margin-left: 0 !important;
}

.wapf-custom-text {
    width: 100% !important;
    max-width: 400px !important;
    padding: 10px 14px !important;
    border: 1px solid #d1d1d1 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.wapf-custom-text:focus {
    border-color: #007cba !important;
    box-shadow: 0 0 0 1px #007cba !important;
    outline: none !important;
}

.wapf-pricing-hint {
    color: #616161 !important;
    font-size: 0.9em !important;
    margin-left: 10px !important;
    font-style: italic !important;
}

/* Ensure global container is clean */
.wapf-checkboxes,
.wapf-radios {
    margin-top: 10px !important;
}

/* ---------- Mobile: touch-friendly; when custom text + price, stack text below ---------- */
@media screen and (max-width: 768px) {
    .wapf-slider-mode {
        align-items: center !important;
        padding: 8px 0 !important;
        min-height: 44px !important;
    }

    /* When option has image + label + custom text: only the placeholder/custom text box goes to next line. */
    .wapf-slider-mode.wapf-option-has-custom-text {
        flex-wrap: wrap !important;
        min-height: 52px !important; /* taller first row so stepper + option + price fit on one line */
        padding: 10px 0 !important;
    }

    /* First row: stepper + image + option name + price all on ONE line (increase height to fit) */
    .wapf-slider-mode.wapf-option-has-custom-text .wapf-qty-stepper {
        order: -1 !important;
        flex-shrink: 0 !important;
        height: 48px !important;
    }
    .wapf-slider-mode.wapf-option-has-custom-text .wapf-qty-stepper .wapf-qty-btn,
    .wapf-slider-mode.wapf-option-has-custom-text .wapf-qty-stepper input.wapf-qty {
        height: 48px !important;
    }
    .wapf-slider-mode.wapf-option-has-custom-text .wapf-qty-stepper .wapf-qty-btn {
        width: 48px !important;
    }
    .wapf-slider-mode.wapf-option-has-custom-text .wapf-input-label {
        order: 0 !important;
        flex: 1 1 0% !important;
        min-width: 0 !important;
        max-width: calc(100% - 80px) !important; /* reserve space for stepper so label stays on first row */
        flex-wrap: wrap !important; /* allow option name + price to wrap to next line within the row if needed */
        align-items: center !important;
    }
    .wapf-slider-mode.wapf-option-has-custom-text .wapf-input-label .wapf-option-image {
        flex-shrink: 0 !important;
    }
    .wapf-slider-mode.wapf-option-has-custom-text .wapf-input-label .wapf-label-text {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        /* no ellipsis: let text wrap so full option name + price are visible; row height will grow */
    }
    .wapf-slider-mode.wapf-option-has-custom-text .wapf-custom-text-wrapper {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        order: 1 !important;
        margin-top: 10px !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        min-height: 44px !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .wapf-slider-mode.wapf-option-has-custom-text .wapf-custom-text {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        border-left: 3px solid rgba(0, 124, 186, 0.4) !important;
        margin-left: 0 !important;
        display: block !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .wapf-qty-stepper {
        height: 44px !important;
        margin-right: 10px !important;
    }

    .wapf-qty-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
    }

    .wapf-qty-stepper input.wapf-qty {
        width: 44px !important;
        height: 44px !important;
        font-size: 16px !important;
    }

    .wapf-slider-mode .wapf-input-label {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .wapf-slider-mode .wapf-label-text {
        font-size: 15px !important;
    }

    .wapf-custom-text {
        max-width: 100% !important;
        padding: 12px 14px !important;
        font-size: 16px !important; /* avoid zoom on focus in iOS */
    }

    .wapf-pricing-hint {
        font-size: 0.85em !important;
        margin-left: 6px !important;
    }

    .wapf-image-lightbox__content {
        max-width: 96vw !important;
        max-height: 90vh !important;
        padding: 16px !important;
    }

    .wapf-image-lightbox__content img {
        max-width: 90vw !important;
        max-height: 80vh !important;
    }

    .wapf-image-lightbox__close {
        top: -8px !important;
        right: -8px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 28px !important;
    }
}