/* --- MODERN & RESPONSIVE CALCULATOR STYLES (THEME INHERITED & HIGHLY COMPATIBLE) --- */

/* --- 1. Global Styles --- */
.cgc-calculator {
    /* font-family removed to inherit from theme */
    border: 1px solid #dce4e9;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

/* --- 2. Step-by-Step Sections --- */
.cgc-step {
    padding: 20px 25px;
    border-bottom: 1px solid #dce4e9;
}
.cgc-step:last-of-type {
    border-bottom: none;
}
.cgc-step-title {
    /* font-size, font-weight, color removed */
    margin: 0 0 15px 0;
}
.cgc-step-desc {
    /* font-size, color removed */
    margin: -10px 0 15px;
}

/* --- 3. Option Buttons (General) --- */
.cgc-option-group {
    display: flex;
    flex-wrap: wrap;
    margin: -6px; /* Replaces gap with negative margin on parent */
}
.cgc-option-btn {
    flex-grow: 1;
    flex-basis: 150px; /* Base size for larger screens */
    padding: 12px;
    margin: 6px; /* Replaces gap with margin on child */
    border: 2px solid #dce4e9;
    background: #ffffff;
    /* color removed */
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    text-align: center;
}
.cgc-option-btn:hover {
    border-color: #0073e6;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.cgc-option-btn.active {
    background-color: #e6f2ff;
    border-color: #0073e6;
    box-shadow: none;
}
.cgc-option-btn:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.7;
    border-color: #ddd;
    transform: none;
    box-shadow: none;
}
.cgc-option-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* Gap replacement for children of cgc-option-btn-content */
.cgc-option-btn-content > * {
    margin-bottom: 10px;
}
.cgc-option-btn-content > *:last-child {
    margin-bottom: 0;
}
.cgc-option-icon {
    height: 36px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a6b7b;
}
.cgc-option-btn.active .cgc-option-icon {
    color: #0073e6;
}
.cgc-option-icon svg {
    height: 100%;
    width: auto;
}
.cgc-option-photo {
    height: 50px;
    width: 100%;
    max-width: 120px;
    border-radius: 6px;
    background-color: #e9e9e9;
    background-image: linear-gradient(45deg, #f7f7f7 25%, transparent 25%), linear-gradient(-45deg, #f7f7f7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f7f7f7 75%), linear-gradient(-45deg, transparent 75%, #f7f7f7 75%);
    background-size: 20px 20px;
    border: 1px solid #dce4e9;
}
.cgc-option-text {
    /* font-weight, font-size, color removed */
}

/* --- 3a. Glass Type Specific Styles --- */
#cgc-type .cgc-type-btn {
    flex-basis: calc(50% - 12px); /* Two columns */
}
#cgc-type .cgc-option-btn-content {
    margin-bottom: 0; /* Remove gap for buttons with no icon/photo */
}
.cgc-dynamic-desc {
    display: none; /* Hide all descriptions by default */
    width: 100%; /* Take up full width */
    margin: 10px 6px 0 6px; /* Match button margin */
    padding: 15px;
    background-color: #f7f9fb;
    border-radius: 8px;
    border: 1px solid #dce4e9;
    /* font-size, color, line-height removed to inherit from theme */
}
/* Show the description that IMMEDIATELY follows an active button */
.cgc-option-btn.active + .cgc-dynamic-desc {
    display: block;
}


/* --- 4. Input Fields --- */
.cgc-dimension-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin: -10px; /* Replaces gap */
}
.cgc-dim-input {
    display: flex;
    align-items: center;
    margin: 10px; /* Replaces gap */
}
/* Gap replacement for children of cgc-dim-input */
.cgc-dim-input > * {
    margin-right: 8px;
}
.cgc-dim-input > *:last-child {
    margin-right: 0;
}

.cgc-dim-input label {
    /* font-weight, color removed */
}
.cgc-dim-input input[type="number"],
.cgc-dim-input select,
#cgc-bevel-width,
#cgc-corners-radius {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #dce4e9;
    background-color: #ffffff;
    /* font-size removed */
    transition: border-color 0.2s;
}
.cgc-dim-input input[type="number"]:focus,
.cgc-dim-input select:focus {
    border-color: #0073e6;
    outline: none;
}
.cgc-dim-input input[type="number"] {
    width: 80px;
}

/* --- 5. Summary & Price Section --- */
.cgc-summary-wrapper {
    margin: 0;
    padding: 25px;
    background: #f7f9fb;
    border-top: 1px solid #dce4e9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}
#cgc-summary {
    flex: 1 1 55%;
    min-width: 280px;
    padding: 0 10px; /* Replaces gap */
}
.cgc-summary-title {
    /* font-size, font-weight, color removed */
    margin: 0 0 10px 0;
}
#cgc-summary-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#cgc-summary-details li {
    padding: 4px 0;
    /* font-size, color removed */
}
#cgc-summary-details li strong {
    /* color removed */
}
#cgc-summary-weight, #cgc-summary-tolerance {
    /* font-size, color removed */
    margin-top: 10px;
}

#cgc-price-section {
    text-align: right;
    flex: 1 1 40%;
    min-width: 220px;
    padding: 0 10px; /* Replaces gap */
}
#cgc-error-message {
    color: #e74c3c; /* Kept for user feedback */
    /* font-weight removed */
    min-height: 24px;
    margin-bottom: 5px;
}
#cgc-price-display {
    /* font-size, font-weight, color, line-height removed */
    margin-bottom: 15px;
}
#cgc-add-to-cart-btn {
    width: 100%;
}

/* --- 6. Responsive Design --- */
@media (max-width: 768px) {
    .cgc-step {
        padding: 20px;
    }
    .cgc-option-btn {
        flex-basis: calc(50% - 12px); /* Two columns on tablets, accounting for margin */
    }
    .cgc-summary-wrapper {
        flex-direction: column-reverse; /* Stack price above summary on mobile */
        align-items: stretch;
    }
    #cgc-price-section {
        text-align: left;
        border-bottom: 1px solid #dce4e9;
        padding-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .cgc-option-btn {
        flex-basis: 100%; /* Full width on small phones */
    }
    .cgc-dimension-group {
        flex-direction: column;
        align-items: stretch;
        margin: 0;
    }
    .cgc-dim-input {
        margin: 5px 0;
    }
}
