/* Bike Options - Category-based Selection System */
/* Minimal styling - relies on existing site CSS for buttons, colors, typography */

/* Download Quote Button - White with Red Border */
.btn-outline-download {
    background-color: #f5f5f5 !important;
    color: #c00 !important;
    border: 2px solid #c00 !important;
}

.btn-outline-download:hover {
    background-color: #f8f8f8 !important;
    color: #c00 !important;
    border-color: #c00 !important;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--bs-border-color, #ddd);
}

.category-box {
    border: 2px solid var(--bs-border-color, #ddd);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FFFFFF;
    position: relative;
    min-height: 280px;
    max-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
}

.category-box:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.category-box.has-selection {
    background-color: #F5F5F5;
    justify-content: space-between;
    gap: 0.75rem;
}

.category-icon {
    width: 60px;
    height: 60px;
    margin: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.category-box:not(.has-selection) .category-icon {
    display: none;
}

.category-box.has-selection .category-icon {
    width: 100%;
    height: auto;
    display: flex;
    flex-grow: 1;
    max-height: 180px;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(1);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.category-box.has-selection .category-icon img {
    filter: grayscale(0);
    transform: scale(1);
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    height: 100%;
}

.category-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 2rem;
    font-weight: bold;
    background-color: var(--bs-gray-200, #e9ecef);
    border-radius: 50%;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.category-box:not(.has-selection) .category-icon-fallback {
    display: none;
}

.category-name {
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    font-size: 0.9rem;
    min-height: 2.4em;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    transition: all 0.3s ease;
}

.category-box:not(.has-selection) .category-name {
    position: absolute;
    top: 0.5rem;
    font-size: 0.75rem;
    min-height: auto;
}

.category-box.has-selection .category-name {
    display: none;
}

.category-selected-name {
    font-weight: 600;
    font-size: 0.9rem;
    min-height: 2.4em;
    line-height: 1.2;
    display: none;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
    flex-shrink: 0;
}

.category-box.has-selection .category-selected-name {
    display: -webkit-box;
}

.category-selection {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1;
    justify-content: center;
}

.category-box:not(.has-selection) .category-selection {
    height: 100%;
}

.category-box.has-selection .category-selection {
    flex-grow: 0;
    justify-content: flex-start;
    flex-shrink: 0;
}

/* Category and extra selection buttons - circular add/select buttons */
.category-add-btn {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: transparent;
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 0 0.15em 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.extra-select-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: transparent;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 0 0.1em 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-add-btn:hover,
.extra-select-btn:hover {
    transform: scale(1.1);
}

.category-add-btn.selected {
    display: none;
}

.category-box.has-selection .category-add-btn {
    display: none;
}

.extra-option.selected .extra-select-btn {
    background: #E42327;
    color: white;
    border-color: #E42327;
}

.category-selected-price {
    font-weight: bold;
    font-size: 1rem;
    display: none;
    min-height: 1.2em;
    margin: 0;
    flex-shrink: 0;
}

.category-box.has-selection .category-selected-price {
    display: block;
}

.category-selected-name {
    display: none;
}

/* Pricing Summary */
.pricing-summary {
    padding-top: 1rem;
    font-size: 1.1rem;
}

.pricing-summary .d-flex {
    margin-bottom: 0.5rem;
}

.pricing-summary .price-decimal {
    font-size: 1rem;
    font-weight: normal;
}

.pricing-summary .total-amount {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.pricing-summary .total-amount .price-decimal {
    font-size: 1rem;
    font-weight: 400;
}

.base-price-row .total-amount {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.extras-price-row .total-amount {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}


.total-price-row .total-amount {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.total-price-row .total-amount .total-decimal {
    font-size: 1rem;
    font-weight: 400;
    vertical-align: baseline;
}

.total-price-row .total-amount sup {
    font-size: 0.6rem;
    font-weight: 400;
}

/* Modal Extras List */
.extras-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.extra-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--bs-border-color, #ddd);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--bs-white, #fff);
    gap: 1rem;
}

.extra-option:not(.disabled) {
    cursor: pointer;
}

.extra-option:not(.disabled):hover {
    background-color: var(--bs-gray-100, #f8f9fa);
}

.extra-option.selected {
    background-color: #F5F5F5;
}

.extra-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bs-gray-200, #e9ecef);
}

.extra-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.extra-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.extra-info {
    flex: 1;
}

.extra-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.extra-price {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Modal Sizing and Scrolling - Limit height for many options */
#categoryModal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Ensure smooth scrolling */
#modal-extras-list {
    overflow-x: hidden;
}

/* Responsive adjustments */
@media (max-width: 1200px) and (min-width: 769px) {
    .category-box {
        min-height: 320px;
        max-height: 320px;
    }
    
    .category-box.has-selection .category-icon {
        max-height: 150px;
    }
    
    .category-add-btn {
        width: 70px;
        height: 70px;
        min-width: 70px;
        min-height: 70px;
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .category-box {
        min-height: 280px;
        max-height: 280px;
        padding: 1rem 0.5rem;
    }
    
    .category-box.has-selection .category-icon {
        max-height: 140px;
    }
    
    .category-icon {
        width: 50px;
        height: 50px;
    }
    
    .category-icon-fallback {
        width: 50px;
        height: 50px;
        line-height: 50px;
        font-size: 1.5rem;
    }
    
    .category-add-btn {
        width: 60px;
        height: 60px;
        min-width: 60px;
        min-height: 60px;
        font-size: 2rem;
    }

}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}