/* WP Calculator Field Frontend Styles */

/* Заголовок калькулятора убран из интерфейса */

.wp-calculator-field {
    background: #f4f6f8;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}


.wp-calculator-field h3 {
    font-size: 16px;
    color: #333;
    font-weight: 700;
    margin-bottom: 20px;
}

.wp-calculator-dynamic-price {
    margin-top: 10px;
}


.calculator-field {
    margin-bottom: 15px;
}

.calculator-field label {
    display: block;
    margin-top: 0;
    font-size: 16px;
    color: #333;
    font-weight: 700;
}

.calculator-field .required {
    color: #e74c3c;
    font-weight: bold;
}

.wp-calculator-field-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: left;
    flex-direction: row-reverse;
}

.wp-calculator-field-checkbox input {
    width: auto;
}

.calculator-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.calculator-input.field-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}


/* Элементы итоговой суммы и кнопок убраны из интерфейса */

/* Индикация загрузки */
.calculator-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.calculator-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: calculator-spin 1s linear infinite;
}

.calculator-loading {
    position: relative;
}

@keyframes calculator-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Блок отображения цены */
.wp-calculator-price-display {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wp-calculator-price-display .price-main {
    font-size: 32px;
    font-weight: 700;
    color: #000;
    margin: 0 0 12px 0;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-calculator-price-display .price-original {
    font-size: 20px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
}

.wp-calculator-price-display .price-savings { display: none; }
.wp-calculator-price-display .savings-label { margin-right: 6px; }
.wp-calculator-price-display .savings-amount { font-weight: 600; }


.wp-calculator-price-display .price-vat {
}

.woocommerce-variation {
    display: none;
    visibility: hidden;
}

.wp-calculator-dynamic-price {
    display: none;
}

.wp-calculator-price-display .add-to-cart-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.wp-calculator-price-display .quantity-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
}

.wp-calculator-price-display .quantity-wrapper label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wp-calculator-price-display .calculator-quantity {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    background: #fff;
    transition: border-color 0.3s ease;
}

.wp-calculator-price-display .calculator-quantity:focus {
    outline: none;
    border-color: #e22329;
}

.wp-calculator-price-display .add-to-cart-btn {
    background: #e22329;
    color: #fff;
    border: none;
    padding: 9px 30px;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 500;
    flex: 1;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
}

.wp-calculator-price-display .add-to-cart-btn:hover {
    background: #e22329;
}

.wp-calculator-price-display .add-to-cart-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* Индикатор загрузки для блока цены */
.wp-calculator-price-display.loading {
    position: relative;
    pointer-events: none;
}

.wp-calculator-price-display.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.wp-calculator-price-display.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e22329;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .wp-calculator-field {
        padding: 15px;
        margin: 15px 0;
    }

    .calculator-field {
        padding: 12px;
    }

    .field-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .calculator-spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }

    .wp-calculator-price-display {
        padding: 15px;
        margin: 15px 0;
    }

    .wp-calculator-price-display .price-main {
        font-size: 27px;
        flex-direction: column;
        align-items: start;
        gap: 8px;
    }

    .wp-calculator-price-display .price-main .current-price {
        display: flex;
        gap: 15px;
        flex-direction: row-reverse;
        align-items: center;
    }

    .wp-calculator-price-display .price-main del {
        text-decoration: none;
        color: #abacad;
        font-size: 16px;
    }

    .wp-calculator-price-display .current-price ins {
        text-decoration: none !important;
    }

    .wp-calculator-price-display .price-original {
        font-size: 18px;
    }

    .wp-calculator-price-display .price-savings {
        font-size: 13px;
        padding: 6px 10px;
    }

    .wp-calculator-price-display .add-to-cart-section {
        flex-direction: column;
        gap: 10px;
    }

    .wp-calculator-price-display .quantity-wrapper {
        min-width: auto;
        width: 100%;
    }

    .wp-calculator-price-display .add-to-cart-btn {
        padding: 12px 20px;
        font-size: 15px;
        width: 100%;
    }
}