/* ==========================================================================
   Become1 Price Box Component - BEM Structure
   ========================================================================== */

/* CSS Custom Properties */
:root {
    --become1-border-default: #e1e1e1;
    --become1-border-active: #3e3e40;
    --become1-border-hover: #00a5e3;
    --become1-bg: #fff;
    --become1-text: #3e3e40;
    --become1-text-muted: #878787;
    --become1-badge: #91cd50;
    --become1-padding: 15px;
    --become1-gap: 15px;
    --become1-transition: 0.2s ease;
    --become1-radius: 4px;
}

/* ==========================================================================
   Price Box Group - Container
   ========================================================================== */
.c-price-box-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--become1-gap);
    margin-bottom: 15px;
}

/* ==========================================================================
   Price Box - Base Component (applies to BOTH boxes)
   ========================================================================== */
.c-price-box {
    flex: 1 1 200px;
    min-width: 180px;
    position: relative;
    background: var(--become1-bg);
    padding: var(--become1-padding);
    border: 1px solid var(--become1-border-active);
    border-radius: var(--become1-radius);
    box-sizing: border-box;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--become1-transition), box-shadow var(--become1-transition);
}

/* ==========================================================================
   Button Reset - Critical for button.c-price-box
   ========================================================================== */
button.c-price-box {
    font: inherit;
    font-size: inherit;
    line-height: inherit;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--become1-bg);
    border: 1px solid var(--become1-border-active);
    margin: 0;
}

/* ==========================================================================
   Price Box Hover & Focus States (applies to BOTH boxes)
   ========================================================================== */
.c-price-box:hover,
.c-price-box:focus {
    border-color: var(--become1-border-hover);
    box-shadow: 0 0 0 2px rgba(0, 165, 227, 0.2);
    outline: none;
}

/* ==========================================================================
   Price Box Modifiers
   ========================================================================== */

/* Standard price box (left) - display only, NOT interactive */
#product .c-price-box--standard {
    border: 1px solid var(--become1-border-active);
    border-radius: 0;
    cursor: default;
}

/* Standard box: NO hover/focus effects */
#product .c-price-box--standard:hover,
#product .c-price-box--standard:focus {
    border-color: var(--become1-border-active);
    box-shadow: none;
}

/* MPP/Employee price box (right, interactive) - NO border per XD mockup */
#product .c-price-box--mpp,
#product button.c-price-box--mpp {
    border: none;
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    background-color: var(--become1-bg);
    cursor: pointer;
}

/* MPP box hover/focus - use shadow instead of border */
#product .c-price-box--mpp:hover,
#product .c-price-box--mpp:focus {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    outline: none;
}

/* ==========================================================================
   Price Box Elements
   ========================================================================== */

/* Label/Heading */
.c-price-box__label {
    font-size: 14px;
    font-weight: 700;
    color: var(--become1-text);
    margin-bottom: 5px;
    min-height: 20px;
    line-height: 1.4;
}

/* Price value */
.c-price-box__price {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--become1-text);
    line-height: 1.1;
    margin-bottom: 5px;
}

/* Period text (e.g., "pro Monat inkl. MwSt") */
.c-price-box__period {
    display: block;
    font-size: 14px;
    color: var(--become1-text);
    line-height: 1.4;
}

/* Duration text (e.g., "36 Monate Laufzeit") */
.c-price-box__duration {
    display: block;
    font-size: 14px;
    color: var(--become1-text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   Badge (Tipp triangle) - Larger size per XD mockup
   ========================================================================== */
#product .c-price-box__badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 70px 70px 0;
    border-color: transparent #91cd50 transparent transparent;
    border-top-right-radius: 0;
    overflow: visible;
}

#product .c-price-box__badge-text {
    position: absolute;
    top: 8px;
    right: -65px;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    transform: rotate(45deg);
    text-transform: uppercase;
}

/* ==========================================================================
   Screen Reader Live Region
   ========================================================================== */
.c-price-box__live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Mobile: Boxes stacked vertically */
@media (max-width: 480px) {
    .c-price-box {
        flex: 1 1 100%;
        padding: 12px;
    }

    .c-price-box__price {
        font-size: 24px;
    }

    .c-price-box[aria-pressed="true"] {
        padding: 11px; /* Compensate for thicker border */
    }
}

/* Small tablets: Boxes side by side with reduced padding */
@media (min-width: 481px) and (max-width: 767.98px) {
    .c-price-box {
        padding: 12px;
    }

    .c-price-box__price {
        font-size: 24px;
    }

    .c-price-box[aria-pressed="true"] {
        padding: 11px;
    }
}

/* Tablets and up: Full styling */
@media (min-width: 768px) {
    .c-price-box {
        padding: var(--become1-padding);
    }

    .c-price-box__price {
        font-size: 28px;
    }
}

/* ==========================================================================
   Legacy Support - Keeping old class for backwards compatibility
   ========================================================================== */
.become1-flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--become1-gap);
}

@media (max-width: 480px) {
    .become1-flex-container {
        flex-direction: column;
    }

    .become1-flex-container > div:first-child {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* ==========================================================================
   Tooltip Component - Info Icon with Hover Content
   ========================================================================== */

#product .c-tooltip--mpp {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    cursor: help;
}

#product .c-tooltip__icon {
    font-size: 14px;
    color: #0073b1;
    transition: color var(--become1-transition);
}

#product .c-tooltip--mpp:hover .c-tooltip__icon,
#product .c-tooltip--mpp:focus .c-tooltip__icon {
    color: #005a8c;
}

#product .c-tooltip__content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    padding: 10px 12px;
    background: #3e3e40;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    margin-bottom: 8px;
    text-align: left;
    pointer-events: none;
}

/* Tooltip arrow */
#product .c-tooltip__content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #3e3e40;
}

/* Show tooltip on hover and focus */
#product .c-tooltip--mpp:hover .c-tooltip__content,
#product .c-tooltip--mpp:focus .c-tooltip__content {
    opacity: 1;
    visibility: visible;
}

/* Focus outline for accessibility */
#product .c-tooltip--mpp:focus {
    outline: 2px solid #0073b1;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Responsive: Adjust tooltip position on small screens */
@media (max-width: 480px) {
    #product .c-tooltip__content {
        width: 200px;
        left: auto;
        right: -10px;
        transform: none;
    }

    #product .c-tooltip__content::after {
        left: auto;
        right: 15px;
        transform: none;
    }
}

/* ==========================================================================
   Modal Scrolling Fix - Lock body scroll and ensure modal content scrolls
   ========================================================================== */

/* Lock body scroll when become1 modal is open */
html.become1-modal-open,
body.become1-modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
    /* Safari-specific scroll lock */
    -webkit-overflow-scrolling: auto;
    touch-action: none;
}

/* Custom backdrop for become1 modals */
.become1-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99998;
}

/* Hide Bootstrap's backdrop when become1 modals are open */
body.become1-modal-open .modal-backdrop {
    display: none !important;
}

/* Modal dialog - limit width */
#become1Modal .modal-dialog,
#become1EmailModal .modal-dialog {
    max-width: 900px;
}

/* Modal content - flex container for scrolling */
#become1Modal .modal-content,
#become1EmailModal .modal-content {
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Modal header - become1 specific styling */
.become1-modal-header {
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: none;
    padding: 40px 40px 0 40px;
    flex-shrink: 0;
}

/* Modal body - become1 specific styling */
.become1-modal-body {
    padding: 30px 40px 40px 40px;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    #become1Modal .modal-content,
    #become1EmailModal .modal-content {
        max-height: calc(100vh - 20px);
    }

    .become1-modal-header {
        padding: 25px 25px 0 25px;
    }

    .become1-modal-body {
        padding: 15px 25px 25px 25px;
    }
}

/* Prevent background scroll when modal is open - Safari fix */
#become1Modal.in,
#become1EmailModal.in,
#become1Modal.show,
#become1EmailModal.show {
    overscroll-behavior: contain;
}

/* Email modal specific - stronger scroll containment for Safari */
#become1EmailModal {
    -webkit-overflow-scrolling: touch;
    overflow: hidden;
}

#become1EmailModal .modal-dialog {
    overflow: hidden;
    max-height: 100vh;
}

#become1EmailModal .modal-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Modal Vertical Centering - Flexbox-based centering
   Overrides the dynamic margin-top from centerModals() in index.html
   ========================================================================== */

/* Flexbox centering on the vertical-alignment-helper wrapper */
#become1Modal .vertical-alignment-helper,
#become1EmailModal .vertical-alignment-helper {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Remove default margin from modal-dialog */
#become1Modal .modal-dialog,
#become1EmailModal .modal-dialog {
    margin: 0;
}

/* Override dynamic margin-top and ensure proper scrolling */
#become1Modal .modal-content,
#become1EmailModal .modal-content {
    margin-top: 0 !important;
    max-height: 95vh;
    overflow-y: auto;
}
