/* CPM Calculator CSS - Updated for three-column layout with 2-column window types */

.cpm-calculator-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0 auto;
    max-width: 1200px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.cpm-calculator-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cpm-calculator-header h2 {
    color: #2c3e50;
    font-weight: 600;
}

.cpm-calculator-header p {
    color: #7f8c8d;
    font-size: 16px;
}

/* Window selector (left column) */
.cpm-window-selector {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    height: 100%;
}

.cpm-window-selector h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Главната промяна - винаги 2 колони на десктоп */
.cpm-window-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.cpm-window-type-item {
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 120px; /* Осигуряваме минимална височина за еднакъв размер */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cpm-window-type-item:hover {
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cpm-window-type-item.active {
    border-color: #2980b9;
    background-color: #ebf5fb;
}

.cpm-window-type-item img {
    max-width: 100%;
    height: auto;
    max-height: 60px; /* Ограничаваме височината на изображенията */
    margin-bottom: 8px;
    object-fit: contain; /* Запазваме пропорциите */
}

.cpm-window-type-name {
    font-size: 12px; /* Намаляваме шрифта леко */
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

/* Form section (middle column) */
.cpm-form-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.cpm-form-section h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Canvas and visual display (right column) */
.cpm-visual-editor {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cpm-canvas-container {
    position: relative;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    width: 100%;
    height: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#cpm-window-canvas {
    display: block;
    max-width: 100%;
    max-height: 400px;
    margin: 0 auto;
}

.cpm-dimension-labels {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #eee;
    font-size: 14px;
}

.cpm-width-label, .cpm-height-label {
    margin: 5px 0;
    font-weight: 500;
}

/* Price display */
.cpm-price-display {
    background-color: #2c3e50;
    color: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.cpm-price-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.cpm-price-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.cpm-price-details {
    font-size: 14px;
    color: #bdc3c7;
    margin-bottom: 15px;
}

/* Buttons styling */
.cpm-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cpm-buttons .btn {
    width: 100%;
    position: relative;
}

/* Badge with cart count */
.cpm-cart-count {
    margin-left: 5px;
    vertical-align: middle;
    font-size: 0.75em;
    padding: 0.25em 0.5em;
    border-radius: 0.375rem;
}

/* Checkout page styles */
.cpm-checkout-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0 auto;
    max-width: 1200px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.cpm-checkout-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cpm-checkout-header h2 {
    color: #2c3e50;
    font-weight: 600;
}

.cpm-checkout-header p {
    color: #7f8c8d;
    font-size: 16px;
}

.cpm-windows-list {
    margin-bottom: 20px;
}

.cpm-windows-list .table {
    margin-bottom: 0;
}

.cpm-windows-list th {
    background-color: #f8f9fa;
}

.cpm-order-form {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
}

.cpm-total-price {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 20px;
}

.cpm-total-price h5 {
    margin-bottom: 5px;
    color: #6c757d;
}

/* Error message styling */
.cpm-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Form validation styles */
.is-invalid {
    border-color: #dc3545 !important;
}

.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Responsive media queries */
@media (max-width: 992px) {
    .cpm-window-types-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .cpm-window-type-item {
        min-height: 100px;
        padding: 8px;
    }
    
    .cpm-window-type-item img {
        max-height: 50px;
    }
    
    .cpm-window-type-name {
        font-size: 11px;
    }
    
    .cpm-canvas-container {
        height: 350px;
    }
    
    .cpm-order-form {
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .cpm-window-types-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .cpm-window-type-item {
        min-height: 80px;
        padding: 6px;
    }
    
    .cpm-window-type-item img {
        max-height: 40px;
    }
    
    .cpm-window-type-name {
        font-size: 10px;
    }
    
    .cpm-canvas-container {
        height: 300px;
    }
    
    .cpm-form-section, .cpm-price-display {
        margin-top: 15px;
    }
    
    .cpm-buttons {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .cpm-window-types-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .cpm-window-type-item {
        min-height: 70px;
        padding: 5px;
    }
    
    .cpm-window-type-item img {
        max-height: 35px;
    }
    
    .cpm-window-type-name {
        font-size: 9px;
    }
    
    .cpm-calculator-container {
        padding: 15px;
    }
    
    .cpm-canvas-container {
        height: 250px;
    }
    
    .cpm-price-value {
        font-size: 24px;
    }
    
    .cpm-checkout-container {
        padding: 15px;
    }
}

/* Print styles */
@media print {
    .cpm-calculator-container,
    .cpm-checkout-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .cpm-buttons {
        display: none;
    }
    
    .btn {
        display: none;
    }
}