/**
 * ============================================================================
 * PARUSWEB FUNCTIONS - FRONTEND STYLES
 * ============================================================================
 * 
 * Стили для фронтенда сайта (калькуляторы, корзина, личный кабинет)
 * 
 * @package ParusWeb_Functions
 * @version 2.0.0
 */

/* ============================================================================
   КАЛЬКУЛЯТОРЫ
   ============================================================================ */

.calculator-container {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.calculator-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    border-bottom: 2px solid #3aa655;
    padding-bottom: 10px;
}

.calc-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.calc-field {
    flex: 1;
    min-width: 150px;
}

.calc-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.calc-field input,
.calc-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.calc-field input:focus,
.calc-field select:focus {
    outline: none;
    border-color: #3aa655;
    box-shadow: 0 0 0 2px rgba(58, 166, 85, 0.1);
}

.calc-result {
    background: #f5faf7;
    border: 2px solid #3aa655;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.calc-result-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.calc-result-value {
    font-size: 28px;
    font-weight: bold;
    color: #3aa655;
    margin: 10px 0;
}

.calc-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.calc-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.calc-btn-primary {
    background: #3aa655;
    color: #fff;
}

.calc-btn-primary:hover {
    background: #2e8a44;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(58, 166, 85, 0.3);
}

.calc-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.calc-btn-secondary:hover {
    background: #e0e0e0;
}

/* SVG иконки калькуляторов */
.calc-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    fill: #3aa655;
}

/* Подсказки калькулятора */
.calc-hint {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

/* ============================================================================
   ИНФОРМАЦИЯ О ТОВАРЕ
   ============================================================================ */

.product-area-info {
    margin: 15px 0;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 14px;
}

.product-badges {
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.product-badge {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    background: #16a085;
    color: white;
    font-size: 11px;
    border-radius: 3px;
    font-weight: 600;
}

.calculator-hint {
    margin: 10px 0;
    padding: 10px;
    background: #fff3cd;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
}

.leaf-material-notice,
.running-meter-info,
.square-meter-info {
    margin: 15px 0;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
}

.leaf-material-notice {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1976d2;
}

.running-meter-info {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.square-meter-info {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
    color: #6a1b9a;
}

.qty-unit {
    margin-left: 8px;
    color: #666;
    font-size: 14px;
}

/* ============================================================================
   КОРЗИНА
   ============================================================================ */

.cart-calculator-info {
    background: #f0f7ff;
    padding: 10px 12px;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 13px;
}

.cart-calculator-info strong {
    color: #1976d2;
}

.cart-item-meta {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.cart-unit-info {
    color: #999;
    font-size: 12px;
}

/* ============================================================================
   УСЛУГИ ПОКРАСКИ
   ============================================================================ */

.painting-services-section {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.painting-services-section h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #3aa655;
    padding-bottom: 10px;
}

.painting-option {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.painting-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}

.painting-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.painting-colors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.color-option {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.color-option:hover {
    border-color: #3aa655;
    transform: translateY(-2px);
}

.color-option.selected {
    border-color: #3aa655;
    background: #f5faf7;
}

.color-swatch {
    width: 60px;
    height: 60px;
    margin: 0 auto 8px;
    border-radius: 50%;
    border: 2px solid #ddd;
}

.color-name {
    font-size: 12px;
    font-weight: 600;
}

/* ============================================================================
   ЛИЧНЫЙ КАБИНЕТ
   ============================================================================ */

.lk-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.lk-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.lk-tile:hover {
    border-color: #3aa655;
    background: #f5faf7;
    color: #3aa655;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 166, 85, 0.15);
}

.lk-tile svg {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    fill: currentColor;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.woocommerce-MyAccount-navigation ul li {
    border-bottom: 1px solid #f0f0f0;
}

.woocommerce-MyAccount-navigation ul li:last-child {
    border-bottom: none;
}

.woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li a:hover {
    background: #3aa655;
    color: #ffffff;
}

.woocommerce-MyAccount-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Поля компании в ЛК */
#account-jur-fields {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

#account-jur-fields legend {
    font-weight: 600;
    color: #3aa655;
    font-size: 16px;
    margin-bottom: 15px;
}

/* ============================================================================
   CHECKOUT
   ============================================================================ */

.checkout-client-type-wrapper {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

#checkout-jur-fields {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

#checkout-inn-lookup-btn,
#reg-inn-lookup-btn,
#account-inn-lookup-btn {
    background: #2196f3;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

#checkout-inn-lookup-btn:hover,
#reg-inn-lookup-btn:hover,
#account-inn-lookup-btn:hover {
    background: #1976d2;
    transform: translateY(-2px);
}

/* ============================================================================
   ДОСТАВКА
   ============================================================================ */

#delivery-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px solid #e0e0e0;
}

.delivery-cost-info {
    background: #f0f7ff;
    padding: 15px;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    margin: 15px 0;
}

.delivery-cost-info strong {
    color: #1976d2;
    font-size: 18px;
}

/* ============================================================================
   АДАПТИВНОСТЬ
   ============================================================================ */

@media (max-width: 768px) {
    .calculator-container {
        padding: 20px 15px;
    }
    
    .calc-row {
        flex-direction: column;
    }
    
    .calc-field {
        min-width: 100%;
    }
    
    .calc-buttons {
        flex-direction: column;
    }
    
    .calc-btn {
        min-width: 100%;
    }
    
    .lk-tiles {
        grid-template-columns: 1fr;
    }
    
    .lk-tile {
        padding: 25px 15px;
    }
    
    .woocommerce-MyAccount-content {
        padding: 20px;
    }
    
    .painting-colors {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .color-swatch {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .calculator-container h3 {
        font-size: 18px;
    }
    
    .calc-result-value {
        font-size: 24px;
    }
    
    .calc-btn {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    #delivery-map {
        height: 300px;
    }
}

/* ============================================================================
   УТИЛИТЫ
   ============================================================================ */

.parusweb-hidden {
    display: none !important;
}

.parusweb-loading {
    opacity: 0.6;
    pointer-events: none;
}

.parusweb-error-message {
    background: #fef2f2;
    border-left: 4px solid #dc3232;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #dc3232;
}

.parusweb-success-message {
    background: #f0fdf4;
    border-left: 4px solid #46b450;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    color: #46b450;
}

.parusweb-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3aa655;
    animation: parusweb-spin 0.8s linear infinite;
}

@keyframes parusweb-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================================
   ПЕРЕХОД В KD CALCULATOR ИЗ КАРТОЧКИ ТОВАРА
   ============================================================================ */

.parusweb-kdcalc-bridge {
    margin: 18px 0 8px;
}

.parusweb-kdcalc-bridge-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 14px 18px;
    border: 0;
    border-radius: 8px;
    background: #8cc63f;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 8px 18px rgba(140, 198, 63, 0.22);
}

.parusweb-kdcalc-bridge-btn:hover,
.parusweb-kdcalc-bridge-btn:focus {
    background: #79b22f;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(121, 178, 47, 0.28);
}

.parusweb-kdcalc-bridge-btn:focus {
    outline: 2px solid rgba(121, 178, 47, 0.35);
    outline-offset: 2px;
}
