/* Optional Items 4-Column Layout */
.option-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid #e9ecef;
    gap: 0;
}



.option-row:last-child {
    border-bottom: none;
}

/* Column 1: Checkbox (10%) */
.option-checkbox-col {
    flex: 0 0 10%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.option-checkbox-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color, #007bff);
}

/* Column 2: Description + SKU (50%) */
.option-description-col {
    flex: 0 0 70%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-title {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.3;
    color: white;

}

.option-sku {
    font-size: 12px;
    color: var(--text-muted, #666);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Column 3: Quantity (20%) */
.option-qty-col {
    flex: 0 0 20%;
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
}

.option-qty-dropdown {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    text-align: center;
}

.option-qty-dropdown:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Disabled quantity dropdown styling */
.option-qty-dropdown:disabled {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
    border-color: #ccc;
}

.option-qty-dropdown:disabled:focus {
    box-shadow: none;
    border-color: #ccc;
}

/* Column 4: Price (20%) */
.option-price-col {
    flex: 0 0 20%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: #ccc;
}

/* Price pill styling for fixing and power supply buttons */
.sku-pill-fixing,

.sku-pill-fixing-price,
.optional-item-btn {
    background-color: #28a745;
    color: white;
    padding: 5px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* PSU Price pill styling for lumineon_trade power supply buttons */
.sku-pill-psu,
.sku-pill-fixing-price,
.sku-pill-optional-price {
    background-color: #28a745;
    color: white;
    padding: 5px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* Selected optional items styling */
.optional-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Spec thumbnail and price pill container styling */
.spec-thumbnail {
    position: relative;
    display: inline-block;
    width: 50%;
    max-width: 200px;
    height: 80%;

    .price-pill {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 12px 16px;
        border-radius: 8px;
        font-weight: bold;
        z-index: 10;
        backdrop-filter: blur(4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    /* iPad specific fixes (768px - 1024px) */
    @media screen and (min-width: 768px) and (max-width: 1024px) {

        /* Fix spec thumbnail on iPad */
        .spec-thumbnail {
            max-width: 50%;
            width: 100%;
            overflow: hidden;
            position: relative;
        }

        .spec-thumbnail img {
            width: 100%;
            min-height: 240px;

            object-fit: contain;
        }




        /* Ensure price pill stays within bounds on iPad */
        .price-pill {
            position: absolute;
            top: 15px;
            right: 15px;
            max-width: calc(100% - 30px);
            word-wrap: break-word;
            overflow-wrap: break-word;
            box-sizing: border-box;
        }

        /* Adjust optional items layout for iPad */
        .option-row {
            padding: 10px 6px;
            gap: 10px;
        }

        .option-checkbox-col {
            flex: 0 0 8%;
        }

        .option-description-col {
            flex: 0 0 48%;
        }

        .option-qty-col {
            flex: 0 0 20%;
        }

        .option-price-col {
            flex: 0 0 24%;
            font-size: 13px;
        }

        .option-qty-dropdown {
            width: 55px;
            font-size: 13px;
        }
    }

    /* Responsive adjustments for mobile */
    @media (max-width: 767px) {
        .option-row {
            padding: 8px 4px;
            gap: 8px;
        }

        .option-checkbox-col {
            flex: 0 0 8%;
        }

        .option-description-col {
            flex: 0 0 52%;
        }

        .option-qty-col {
            flex: 0 0 18%;
        }

        .option-price-col {
            flex: 0 0 22%;
        }

        .option-title {
            font-size: 13px;
        }

        .option-sku {
            font-size: 11px;
        }

        .option-qty-dropdown {
            width: 50px;
            font-size: 13px;
        }

        .option-price-col {
            font-size: 13px;
        }

        /* Mobile price pill adjustments */
        .price-pill {
            top: 10px;
            right: 10px;
            padding: 8px 12px;
            font-size: 12px;
            max-width: calc(100% - 20px);
        }
    }

    /* Header styling for optional items section */
    .fitting-options p {
        margin-bottom: 12px;
        font-size: 14px;
        color: var(--text-muted, #666);
    }

    /* Remove old styling that conflicts */
    .option-content {
        /* Remove old flex styling */
        display: contents;
    }

    .option-content input[type="checkbox"],
    .option-content label {
        /* Reset old styling */
        margin: 0;
    }

    /* Ensure proper alignment with spec-row system */
    .spec-content .option-row {
        /* Override any conflicting spec-row styling */
        margin: 0;
    }
}

/* Optional Items Section */
.fitting-options-section {
    margin-top: 0It;
}

.fitting-options-section h4 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.fitting-options-section p {
    font-size: 0.9rem;
    color: #ccc;
    margin: 0;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
    font-weight: 400;

}

/* Optional Items Container */
.optional-items-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Optional Item Option */
.optional-item-option {
    width: 100%;
}

.optional-item-btn {
    width: 100%;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    /* Ensure the button is properly clickable */
    outline: none;
    user-select: none;
    /* Prevent text selection when clicking */
}

.optional-item-btn:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);

}

.optional-item-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.1);
}

.optional-item-btn.selected {
    border-color: #27ae60;
    background: #f8fff9;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.15);
}

.optional-item-btn.selected:hover {
    border-color: #27ae60;
    background: #f0fff4;
}

/* Optional Button Content */
.optional-btn-content {
    width: 100%;
    pointer-events: none;
    /* Prevent child elements from interfering with button clicks */
}

.optional-btn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    pointer-events: none;
}

.optional-btn-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    pointer-events: none;
}

.optional-btn-header-right {
    display: flex;
    align-items: center;
    margin-left: 1rem;
    pointer-events: none;
}

.optional-checkbox {
    margin-top: 0;
    transform: scale(1.2);
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

/* Prevent checkbox label from interfering with button clicks */
.optional-btn-content h5 {
    margin: 0;
    font-size: 10pt;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--primary-yellow);
    flex: 1;
    pointer-events: none;
}

.optional-description {
    margin: 0.5rem 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.4;
    /* Align with title */
    pointer-events: none;
}

.sku-info {
    margin: 0.75rem 0 0 0;

    /* Align with title */
    pointer-events: none;
}

/* Visual feedback for selection state */
.optional-item-btn[data-selected="true"] {
    border-color: var(--primary-yellow);
    background: var(--primary-yellow-bg);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.15);

}

.optional-item-btn[data-selected="true"] p {
    color: #111111;
}

.optional-item-btn[data-selected="true"] .optional-checkbox {
    /* Checkbox will show as checked automatically */
}


.optional-item-btn {
    margin: 0;
}

.choose-option {
    margin-bottom: 15px !important;
}

.optional-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.remove-optional-btn {
    background: #e74c3c;

    color: #000;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 10px;

}

.remove-optional-btn:hover {
    background: #c0392b;
}

/* Responsive Design */
@media (max-width: 768px) {
    .optional-item-btn {
        padding: 1rem;
    }

    .optional-btn-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .optional-btn-header-right {
        margin-left: 0;
        align-self: flex-start;
    }

    .optional-description,
    .sku-info {
        margin-left: 0;
    }

    .optional-btn-content h5 {
        font-size: 1rem;
    }
}