/* Standalone Railing Calculator Styles */

.standalone-railing-calculator {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

.standalone-railing-calculator h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2em;
    font-weight: 300;
}

.standalone-railing-calculator h4 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 500;
}

.standalone-railing-calculator h5 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 500;
}

/* Customer Information Section */
.customer-info-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.salesperson-info {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf1 100%);
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.salesperson-info h5 {
    margin: 0 0 10px 0;
    color: #007cba;
    font-size: 14px;
    font-weight: 600;
}

.salesperson-details p {
    margin: 5px 0;
    font-size: 13px;
    color: #555;
}

.salesperson-details strong {
    color: #333;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-field {
    flex: 1;
    min-width: 250px;
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-field input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-field input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-field input:invalid {
    border-color: #dc3545;
}

.readonly-field {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    box-sizing: border-box;
    font-weight: 500;
}

/* Runs Container - Side by Side Layout */
.runs-container {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

/* Deck and Stair Runs Sections */
.deck-runs, .stair-runs {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    flex: 1;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.deck-run, .stair-run {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.deck-run:hover, .stair-run:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

.deck-run label, .stair-run label {
    flex-shrink: 0;
    font-weight: 600;
    color: #495057;
    min-width: 140px;
}

.deck-run input, .stair-run input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.deck-run input:focus, .stair-run input:focus {
    outline: none;
    border-color: #007cba;
}

/* Step Icons */
.step-icon {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.deck-runs .step-icon, .stair-runs .step-icon {
    position: absolute;
    top: -17px;
    left: 25px;
}

.calculation-results .step-icon {
    position: absolute;
    top: -17px;
    left: 25px;
}

/* Buttons */
.button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.add-deck-run, .add-stair-run {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.add-deck-run:hover, .add-stair-run:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.remove-run-button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.remove-run-button:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.4);
}

/* Calculation Results */
.calculation-results {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.part-quantities {
    margin-bottom: 25px;
}

.part-quantities h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
}

.part-quantities h5 {
    color: #34495e;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    font-size: 1.2em;
}

.part-quantities ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.part-quantities li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.part-quantities li:last-child {
    border-bottom: none;
}

.part-quantities li:hover {
    background: rgba(0, 124, 186, 0.05);
    padding-left: 10px;
    transition: all 0.3s ease;
}

/* Part Quantities Toggle */
.part-quantities-header {
    margin-bottom: 15px;
}

.part-quantities-header h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

.toggle-parts-details {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #fff;
    border: 2px solid #007cba;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.35);
}

.toggle-parts-details:hover {
    background: linear-gradient(135deg, #005a87 0%, #00476b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 124, 186, 0.45);
}

.part-quantities-details {
    border-top: 2px solid #e9ecef;
    padding-top: 15px;
}

/* Cut Pieces Styling */
.cut-pieces {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #dee2e6;
}

.cut-pieces strong {
    color: #495057;
    font-size: 1.1em;
}

.cut-pieces ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.cut-pieces li {
    border-bottom: none;
    padding: 4px 0;
    font-size: 0.9em;
    color: #6c757d;
}

.cut-pieces li:hover {
    background: none;
    padding-left: 0;
}

/* Total Cost */
.total-cost-wrapper {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    padding: 20px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 10px;
    border: 2px solid #28a745;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2);
}

.total-cost-wrapper h4 {
    margin: 0 0 10px 0;
    color: #155724;
}

.total-cost {
    color: #155724;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Wholesale Pricing Styles */
.wholesale-pricing {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border: 2px solid #2196f3;
}

.wholesale-partner-info {
    background: rgba(33, 150, 243, 0.1);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #1976d2;
}

.pricing-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.retail-price {
    font-size: 0.8em;
    color: #666;
}

.retail-price .crossed-out {
    text-decoration: line-through;
    opacity: 0.7;
}

.wholesale-price {
    font-size: 1.1em;
    color: #1976d2;
}

.wholesale-price strong {
    color: #28a745;
    font-size: 1.2em;
}



/* Profit Margin Slider */
.profit-margin-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 8px;
    border: 2px solid #ffc107;
}

.profit-margin-section h5 {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 1.1em;
}

.profit-margin-slider-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profit-margin-slider-container label {
    font-weight: 600;
    color: #856404;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profit-margin-step {
    position: relative;
    margin-top: 0;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.18);
}

.profit-margin-step .step-icon {
    background: #ffc107;
    color: #856404;
}

.profit-margin-step h5 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profit-margin-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e9ecef;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    cursor: pointer;
}

.profit-margin-slider:hover {
    opacity: 1;
}

.profit-margin-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffc107;
    cursor: pointer;
    border: 2px solid #856404;
}

.profit-margin-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffc107;
    cursor: pointer;
    border: 2px solid #856404;
}

.profit-margin-result {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ffc107;
}

.profit-margin-result strong {
    color: #495057;
    font-size: 1.2em;
}

/* Order Type Selection Styles */
.order-type-selection {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.order-type-selection h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
}

.order-type-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.order-type-option {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.order-type-option.active {
    border-color: #007cba;
    background-color: #f0f8ff;
    cursor: default;
}

.order-type-option:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

.order-type-option input[type="radio"] {
    margin-right: 10px;
}

.order-type-option input[type="radio"]:checked + .option-title {
    color: #007cba;
    font-weight: 600;
}

.order-type-option input[type="radio"]:checked {
    accent-color: #007cba;
}

.order-type-option:has(input[type="radio"]:checked) {
    border-color: #007cba;
    background-color: #f0f8ff;
}

.order-type-option.disabled-option {
    opacity: 0.55;
    cursor: not-allowed;
    border-color: #d3d6da;
    background-color: #f7f8fa;
}

.order-type-option.disabled-option:hover {
    border-color: #d3d6da;
    box-shadow: none;
}

.order-type-option input[type="radio"]:disabled {
    cursor: not-allowed;
}

.option-title {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.option-description {
    display: block;
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

/* Order Details Container */
.order-details-container {
    margin-top: 20px;
}

.order-details {
    transition: all 0.3s ease;
}

/* Kit Quantities Display */
.kit-quantities {
    margin-bottom: 25px;
}

.kit-quantities h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
}

.kit-quantities h5 {
    color: #34495e;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    font-size: 1.2em;
}

.kit-quantities ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kit-quantities li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kit-quantities li:last-child {
    border-bottom: none;
}

.kit-quantities li:hover {
    background: rgba(0, 124, 186, 0.05);
    padding-left: 10px;
    transition: all 0.3s ease;
}

/* Order Selection Section */
.order-selection-section {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.order-selection-section .step-icon {
    position: absolute;
    top: -15px;
    left: 20px;
    background: #ffc107;
    color: #856404;
}

.order-selection-section h4 {
    margin: 0 0 20px 0;
    color: #856404;
    font-size: 1.4em;
    text-align: center;
}

.order-selection-section .order-type-selection {
    margin: 0 0 20px 0;
}

/* Adjustment Notice */
.adjustment-notice {
    background: rgba(255, 193, 7, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
}

.adjustment-notice p {
    margin: 0;
    color: #856404;
    font-style: italic;
    text-align: center;
}

/* Post-calculation order type selection */
.order-type-selection.post-calculation {
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Price Breakdown Section */
.price-breakdown-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.price-breakdown-section h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #007cba;
}

.price-breakdown-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.price-breakdown-item:hover {
    border-color: #007cba;
    box-shadow: 0 2px 4px rgba(0, 124, 186, 0.1);
}

.price-breakdown-item.total {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    font-weight: 600;
    margin-top: 10px;
    padding: 12px 15px;
}

.price-breakdown-item.total .price-label,
.price-breakdown-item.total .price-value {
    font-size: 1.1em;
    color: #155724;
}

.price-label {
    font-weight: 500;
    color: #495057;
    flex: 1;
}

.price-value {
    font-weight: 600;
    color: #333;
    text-align: right;
    min-width: 80px;
}

/* Calculate Section */
.calculate-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    position: relative;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.calculate-section .step-icon {
    position: absolute;
    top: -15px;
    left: 20px;
    background: #28a745;
}

.calculate-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.calculate-section p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 1em;
}

.calculate-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calculate-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.calculate-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Submit Section */
.submit-section {
    text-align: center;
    margin-top: 30px;
}

.submit-quote-button {
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: white;
    padding: 20px 50px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.submit-quote-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 124, 186, 0.5);
}

.submit-quote-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.submit-quote-button:hover::before {
    left: 100%;
}

.submit-quote-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Messages */
.loading-indicator {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.2);
}

.loading-indicator p {
    margin: 0;
    font-weight: 600;
    color: #856404;
}

.success-message {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 30px;
    border: 2px solid #28a745;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.2);
    text-align: center;
}

.success-content h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #155724;
}

.success-message p {
    margin: 0 0 20px 0;
    font-weight: 600;
    font-size: 16px;
}

.start-new-quote-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-new-quote-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
    color: #721c24;
    padding: 20px;
    border: 2px solid #dc3545;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.2);
    text-align: center;
}

.error-message p {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
}

/* Separators */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #dee2e6, transparent);
    margin: 30px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .standalone-railing-calculator {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-field {
        min-width: auto;
    }
    
    .runs-container {
        flex-direction: column;
        gap: 15px;
    }

    .deck-run, .stair-run {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .deck-run label, .stair-run label {
        min-width: auto;
    }
    
    .step-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .deck-runs .step-icon, .stair-runs .step-icon, .calculation-results .step-icon {
        top: -15px;
        left: 15px;
    }
    
    .total-cost {
        font-size: 24px;
    }
    
    .submit-quote-button {
        padding: 12px 30px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .standalone-railing-calculator {
        padding: 10px;
    }
    
    .standalone-railing-calculator h3 {
        font-size: 1.5em;
    }
    
    .customer-info-section,
    .deck-runs,
    .stair-runs,
    .calculation-results {
        padding: 20px;
    }
    
    .total-cost {
        font-size: 22px;
    }
}

/* Animation for showing/hiding sections */
.calculation-results,
.submit-section {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for accessibility */
.button:focus {
    outline: 3px solid rgba(0, 124, 186, 0.5);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .standalone-railing-calculator {
        box-shadow: none;
        max-width: none;
    }
    
    .add-deck-run,
    .add-stair-run,
    .remove-run-button,
    .submit-section,
    .loading-indicator {
        display: none;
    }
    
    .calculation-results {
        page-break-inside: avoid;
    }
}

/* Quote Summary Styling */
.quote-summary-section,
.bill-of-materials-section {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.quote-summary-section h4,
.bill-of-materials-section h4 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.quote-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.quote-info-section {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.quote-info-section h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid #f1f3f4;
}

.info-row .label {
    font-weight: 500;
    color: #6c757d;
    font-size: 14px;
}

.info-row .value {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.info-row.final-price {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #007cba;
    background: #f8f9fa;
    border-radius: 4px;
    padding-left: 10px;
    padding-right: 10px;
}

.info-row.final-price .label,
.info-row.final-price .value {
    font-size: 16px;
    font-weight: 700;
    color: #007cba;
}

/* Color Summary Styling */
.color-fee {
    color: #28a745 !important;
    font-weight: 700;
}

.color-display-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-swatch-small {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.color-info-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.color-name-summary {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
}

.color-value-small {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

/* Materials Table Styling */
.materials-breakdown h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.materials-table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    margin-bottom: 25px;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    background: #007cba;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.table-header span,
.table-row span {
    padding: 12px 15px;
    border-right: 1px solid #dee2e6;
}

.table-header span:last-child,
.table-row span:last-child {
    border-right: none;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
}

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

.table-row:nth-child(even) {
    background: #f8f9fa;
}

.table-row span:nth-child(2),
.table-row span:nth-child(3),
.table-row span:nth-child(4) {
    text-align: right;
    font-weight: 500;
}

/* Run Summary Styling */
.run-summary {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.run-summary h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.run-info .info-row {
    margin-bottom: 5px;
    padding: 5px 0;
}

.run-info .info-row .label {
    font-size: 13px;
    min-width: 100px;
}

.run-info .info-row .value {
    font-size: 13px;
    color: #495057;
}

/* Responsive adjustments for quote summary */
@media (max-width: 768px) {
    .quote-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1.5fr 0.7fr 0.8fr 0.8fr;
        font-size: 12px;
    }
    
    .table-header span,
    .table-row span {
        padding: 8px 10px;
    }
    
    .quote-summary-section,
    .bill-of-materials-section {
        margin: 20px 0;
        padding: 15px;
    }
}

/* Delivery Selection Section */
.delivery-selection-section {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #f39c12;
}

.delivery-selection-section .step-icon {
    background: #f39c12;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
}

.delivery-selection-section h5 {
    color: #8a6d3b;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.delivery-options select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #333;
    transition: border-color 0.3s ease;
}

.delivery-options select:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.delivery-options textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    background: white;
    color: #333;
    transition: border-color 0.3s ease;
}

.delivery-options textarea:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.delivery-options .field-description {
    font-size: 0.9em;
    color: #8a6d3b;
    margin-top: 5px;
    font-style: italic;
}

/* Railing Options Section */
.railing-options-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.railing-options-section .step-icon {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
}

.railing-options-section h5 {
    color: #17a2b8;
    margin: 0 0 20px 0;
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Checkbox styling for railing options */
.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    transition: color 0.3s ease;
}

.checkbox-inline:hover {
    color: #007cba;
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.checkbox-inline input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"]:checked + span {
    color: #007cba;
    font-weight: 600;
}

.checkbox-inline input[type="radio"]:checked + span {
    color: #007cba;
    font-weight: 600;
}

/* Disabled standard color options styling */
.standard-color:disabled,
.handrail-standard-color:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.standard-color:disabled + span,
.handrail-standard-color:disabled + span {
    color: #6c757d !important;
    text-decoration: line-through;
}

.checkbox-inline:has(.standard-color:disabled)::before,
.checkbox-inline:has(.handrail-standard-color:disabled)::before {
    content: "✗ ";
    color: #dc3545;
    font-weight: bold;
    margin-right: 5px;
}

/* Cable Painting Section */
.cable-painting-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cable-painting-section h5 {
    color: #495057;
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.painting-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.painting-options select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #333;
    transition: border-color 0.3s ease;
}

.painting-options select:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.custom-cable-color-section {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.custom-cable-color-section input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #333;
    transition: border-color 0.3s ease;
}

.custom-cable-color-section input[type="text"]:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

/* Color Selection Section */
.color-selection-section {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #4caf50;
}

.color-selection-section .step-icon {
    background: #4caf50;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
}

.color-selection-section h5 {
    color: #2e7d32;
    margin: 0 0 20px 0;
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Graspable Hand Rail Section */
.graspable-handrail-section {
    background: linear-gradient(135deg, #fff7e6 0%, #ffe8c2 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #f39c12;
}

.graspable-handrail-section .step-icon {
    background: #f39c12;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    font-size: 14px;
}

.graspable-handrail-section h5 {
    color: #b86b00;
    margin: 0 0 20px 0;
    font-size: 1.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.graspable-handrail-section .field-description {
    color: #8a5a00;
}

.custom-color-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 10px;
}

.custom-color-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.color-picker-section {
    margin-top: 20px;
}

.color-options-grid {
    margin: 15px 0;
}

.color-instruction {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
    font-style: italic;
}

.color-picker-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 180px;
    padding: 24px;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    background: linear-gradient(135deg, #fffdf7 0%, #f7f7f7 100%);
}

.color-picker-loading-state p {
    margin: 0;
    color: #5f6368;
    font-weight: 600;
}

.color-picker-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(0, 123, 186, 0.18);
    border-top-color: #007cba;
    animation: color-picker-spin 0.85s linear infinite;
}

.color-picker-error-state {
    background: linear-gradient(135deg, #fff7f7 0%, #fff0f0 100%);
    border-color: #f1b9b9;
}

.color-picker-error-state p {
    color: #b42318;
}

@keyframes color-picker-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.selected-color-display {
    background: #f0f8ff;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid #ddd;
}

.selected-color-name,
.main-selected-color-name,
.handrail-selected-color-name {
    color: #2e7d32;
    font-weight: 600;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}

.color-option {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-option:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.color-option.selected {
    border-color: #4caf50;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.5);
}

.color-option.broken-image {
    background: #f0f0f0;
    color: #999;
    font-size: 10px;
    text-align: center;
}

.color-option .no-image-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: #999;
    text-align: center;
    line-height: 1.2;
}

/* Hide old color name display */
.color-name {
    display: none;
}

/* Color Category Tabs */
.color-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 15px 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.tab-button {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: none;
}

.tab-button:hover {
    background: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.tab-button.active {
    background: #2e7d32;
    color: white;
    border-color: #2e7d32;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(46, 125, 50, 0.3);
}

.tab-button.active:hover {
    background: #1b5e20;
}

/* Category Content */
.color-content-container {
    position: relative;
}

.category-content {
    animation: fadeIn 0.3s ease;
}

.category-header {
    color: #2e7d32;
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0 10px 0;
    padding: 8px 12px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    border-left: 4px solid #2e7d32;
    border-radius: 4px;
}

/* Search Styling */
.color-search-container {
    margin: 10px 0;
}

#color-search {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#color-search:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

#color-search::placeholder {
    color: #999;
    font-style: italic;
}

/* Search Results */
.search-results .category-header {
    background: linear-gradient(135deg, #fff3e0 0%, #ffecc6 100%);
    border-left-color: #ff9800;
    color: #ef6c00;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsiveness for tabs */
@media (max-width: 768px) {
    .color-category-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-button {
        border-radius: 6px;
        text-align: center;
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .category-header {
        font-size: 14px;
        margin: 10px 0 8px 0;
        padding: 6px 10px;
    }
    
    #color-search {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
}

/* Locked pricing section styles */
.calculator-edit-locked {
    position: relative;
}

.calculator-edit-locked::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    pointer-events: none;
}

.calculator-edit-locked .color-picker-section,
.calculator-edit-locked .color-options-grid,
.calculator-edit-locked .color-option,
.calculator-edit-locked .handrail-color-option {
    pointer-events: none;
}

.runs-locked-notice {
    position: sticky;
    top: 12px;
    z-index: 40;
    background: linear-gradient(135deg, #fff7d6 0%, #ffe5a6 100%);
    border: 1px solid #f2c86b;
    padding: 14px 16px;
    border-radius: 10px;
    margin: 0 0 18px 0;
    font-size: 14px;
    color: #7a5411;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
    box-shadow: 0 8px 18px rgba(122, 84, 17, 0.14);
}

.runs-locked-message {
    flex: 1;
    line-height: 1.5;
}

.edit-runs-button {
    white-space: nowrap;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #fff;
}

.edit-runs-button:hover {
    background: linear-gradient(135deg, #006799 0%, #004e75 100%);
}

.calculator-edit-locked input.locked {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.calculator-edit-locked button.locked {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.calculator-edit-locked button.locked:hover {
    background-color: #e9ecef;
    transform: none;
}

@media (max-width: 768px) {
    .runs-locked-notice {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

.color-selection-section .field-description {
    font-size: 0.9em;
    color: #2e7d32;
    margin-top: 5px;
    font-style: italic;
}

/* Cable Painting Section in Estimate Details */
.cable-painting-section {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cable-painting-section h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.cable-painting-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.cable-painting-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
}

.cable-painting-card h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.painting-option {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

@media (max-width: 768px) {
    .cable-painting-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .cable-painting-card {
        padding: 15px;
    }
} 
