/* ===== Modern Features Controls Grid ===== */
.custom-controls.features-controls {
    display: grid; 
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem; 
    align-items: stretch; 
    width: 100%; 
    max-width: 100%; 
    padding: 0; 
    margin: 0.5rem 0; 
}

.features-controls .features-controls { max-width: 100%; }
.features-controls .product-subheading { width: 100%; text-align: left; position: relative; }

.features-controls>div {
    display: flex; 
    flex-direction: column; 
    align-items: stretch; 
    justify-content: flex-start; 
    width: 100%;
    padding: 0.75rem 0.9rem 1rem; 
    box-sizing: border-box; 
    border: 1px solid rgba(127, 133, 228, 0.15);
    background: linear-gradient(145deg, rgba(28, 28, 40, 0.9) 0%, rgba(24, 24, 36, 0.95) 100%);
    border-radius: 12px; 
    margin: 0.35rem 0; 
    position: relative; 
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.features-controls>div:hover {
    border-color: rgba(127, 133, 228, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.features-controls>div>* { max-width: 100%; margin: 0.25rem 0; }
.features-controls>div> :last-child { margin-bottom: 0; }

.features-controls>div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
    max-width: none;
}

.features-controls .feature-selected { 
    border: 2px solid var(--colorLeft, #7f85e4); 
    border-radius: 12px; 
    padding: 0.4rem 0.5rem; 
    transition: all 0.3s ease;
    background: rgba(127, 133, 228, 0.05);
    box-shadow: 0 0 0 2px rgba(127, 133, 228, 0.1);
}

.features-controls .feature-selected:hover { 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(127, 133, 228, 0.15);
}

.features-controls .feature-item {
    display: block;
    width: 100%;
    margin-left: 10px;
    position: relative;
    padding: 0.3rem 0.4rem;
    border: 2px solid rgba(127, 133, 228, 0);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.features-controls .feature-item:hover {
    background: rgba(127, 133, 228, 0.03);
}

.features-controls .feature-item.feature-selected { 
    border-color: var(--colorLeft, #7f85e4); 
    background: rgba(127, 133, 228, 0.06);
    box-shadow: inset 0 0 0 1px rgba(127, 133, 228, 0.1);
}

.features-controls .feature-description,
.connector-features-controls .feature-description {
    text-align: center; 
    margin: 4px auto 10px;
    font-size: 12px; 
    color: #8890a0; 
    line-height: 1.4; 
    width: 90%; 
}

/* ===== Modern Feature Labels ===== */
.features-controls label { 
    font-size: clamp(0.82rem, 1.5vw, 0.92rem); 
    margin: 0; 
    padding-left: 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 0.4rem; 
    color: #d0d4e0; 
    width: 100%; 
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ===== Modern Feature Checkboxes ===== */
.features-controls input[type="checkbox"].feature-checkbox { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 20px; 
    height: 20px; 
    border: 2px solid rgba(127, 133, 228, 0.4); 
    border-radius: 6px; 
    background: rgba(44, 44, 70, 0.6);
    margin-right: 0.6rem; 
    vertical-align: middle; 
    position: relative; 
    cursor: pointer; 
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.features-controls input[type="checkbox"].feature-checkbox:hover {
    border-color: var(--colorLeft, rgba(127, 133, 228, 0.7));
    background: rgba(44, 44, 70, 0.8);
    box-shadow: 
        0 0 0 4px rgba(127, 133, 228, 0.1),
        0 0 12px rgba(127, 133, 228, 0.15);
    transform: scale(1.05);
}

.features-controls input[type="checkbox"].feature-checkbox:disabled { 
    border-color: rgba(112, 112, 118, 0.3); 
    background: rgba(44, 44, 70, 0.3);
    opacity: 0.5; 
    cursor: not-allowed; 
}

.features-controls input[type="checkbox"].feature-checkbox:disabled:hover {
    transform: none;
    box-shadow: none;
}

.features-controls input[type="checkbox"].feature-checkbox:checked { 
    background: linear-gradient(135deg, var(--colorLeft, #7f85e4) 0%, var(--colorLeft, #7f85e4) 100%);
    border-color: var(--colorLeft, #7f85e4);
    box-shadow: 
        0 0 0 3px rgba(127, 133, 228, 0.2),
        0 4px 12px rgba(127, 133, 228, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: scale(1);
}

.features-controls input[type="checkbox"].feature-checkbox:checked:hover {
    box-shadow: 
        0 0 0 4px rgba(127, 133, 228, 0.25),
        0 6px 16px rgba(127, 133, 228, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

#produkteList .features-controls input[type="checkbox"].feature-checkbox:checked::after { 
    content: ''; 
    position: absolute; 
    top: 2px;
    left: 6px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    animation: featureCheckmark 0.2s ease-out forwards;
}

@keyframes featureCheckmark {
    0% {
        opacity: 0;
        transform: rotate(45deg) scale(0);
    }
    50% {
        transform: rotate(45deg) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }
}

#produkteList .produkt-block input[type="checkbox"]:not(.feature-checkbox):not(.custom-control-checkbox) { display: none !important; }

/* Compact cross-product connectors */
.produkt-block .custom-controls.connector-features-controls {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(190px, auto);
    gap: 0.8rem;
    width: 100%;
    margin: 0.5rem 0 1rem;
}

.connector-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: clamp(0.55rem, 1.2vw, 0.9rem);
    border: 1px solid rgba(127, 133, 228, 0.24);
    border-radius: 8px;
    background: rgba(18, 18, 31, 0.72);
    box-sizing: border-box;
    container-type: inline-size;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.connector-feature:hover {
    border-color: rgba(127, 133, 228, 0.5);
    background: rgba(25, 25, 42, 0.86);
}

.connector-feature:has(.feature-checkbox:checked) {
    border-color: var(--checkboxColor, #7f85e4);
    background: rgba(127, 133, 228, 0.09);
    box-shadow: inset 0 0 0 1px rgba(127, 133, 228, 0.12);
}

.connector-feature-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    margin-bottom: 0.65rem;
}

.connector-product-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--connector-color-left), var(--connector-color-right));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

.connector-product-icon img {
    width: 29px;
    height: 29px;
    object-fit: contain;
}

.connector-link-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    margin: 0 -2px;
    border: 1px solid rgba(200, 204, 218, 0.45);
    border-radius: 50%;
    background: #25283b;
    color: #f2f3f8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    z-index: 1;
}

.connector-link-mark svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
    stroke: none;
}

.connector-feature .feature-requirement,
.connector-feature .connector-feature-requirement {
    display: none !important;
}

.connector-feature-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    gap: 0.4rem;
}

.connector-features-controls .connector-feature-title-row input[type="checkbox"].feature-checkbox {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 0;
    box-sizing: border-box;
    outline: none;
}

.connector-features-controls .connector-feature-title-row input[type="checkbox"].feature-checkbox:checked::after {
    top: 50%;
    left: 50%;
    width: 4px;
    height: 8px;
    transform: translate(-50%, -58%) rotate(45deg);
    animation: connectorCheckmark 0.2s ease-out forwards;
}

@keyframes connectorCheckmark {
    0% {
        opacity: 0;
        transform: translate(-50%, -58%) rotate(45deg) scale(0);
    }
    50% {
        transform: translate(-50%, -58%) rotate(45deg) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -58%) rotate(45deg) scale(1);
    }
}

.connector-features-controls .connector-feature-label {
    min-width: 0;
    margin: 0;
    color: #e4e7f2;
    font-size: clamp(0.72rem, 0.9vw, 0.8rem);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
}

.custom-controls.features-controls > .feature-item {
    display: flex;
    height: 100%;
    min-height: 0;
}

.custom-controls.features-controls > .feature-item > .control-group {
    margin-top: auto;
}

.connector-features-controls .connector-feature-label .label-title {
    overflow-wrap: anywhere;
    border-bottom-width: 1px;
    padding-bottom: 0.12rem;
}

/* The product price is absolutely positioned on desktop. Reserve its height
   plus a visible gap so connector cards do not touch the price footer. */
@media (min-width: 769px) {
    .produkt-block:has(.connector-features-controls) {
        padding-bottom: 4.55rem;
    }
}

.connector-feature-title-row .info-icon,
.connector-feature-title-row .info-link {
    flex: 0 0 0.8em;
    margin: 0;
    top: 0;
}

.connector-feature-price {
    display: block;
    margin-top: auto;
    padding-top: 0.55rem;
    color: #c7cbd9;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

@container (max-width: 190px) {
    .connector-feature-visual {
        height: 44px;
        margin-bottom: 0.45rem;
    }

    .connector-product-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .connector-product-icon img {
        width: 24px;
        height: 24px;
    }

    .connector-link-mark {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .connector-link-mark svg {
        width: 17px;
        height: 17px;
    }

    .connector-feature-title-row {
        gap: 0.25rem;
    }

    .connector-features-controls .connector-feature-label {
        font-size: 0.76rem;
    }

    .connector-features-controls .connector-feature-title-row input[type="checkbox"].feature-checkbox {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }

    .connector-feature-price {
        font-size: 0.72rem;
    }
}

@container (max-width: 145px) {
    .connector-product-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .connector-product-icon img {
        width: 21px;
        height: 21px;
    }

    .connector-link-mark {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .connector-link-mark svg {
        width: 15px;
        height: 15px;
    }

    .connector-features-controls .connector-feature-label {
        font-size: 0.68rem;
    }

    .connector-feature-title-row .info-icon,
    .connector-feature-title-row .info-link {
        flex-basis: 0.7em;
        width: 0.7em;
        height: 0.7em;
    }
}

@media (max-width: 760px) {
    .produkt-block .custom-controls.connector-features-controls {
        gap: 0.45rem;
    }
}
