/*
Theme Name: Storefront Flora Child
Theme URI: https://zavodflora.com
Description: Дочерняя тема Storefront для Завода ФЛОРА с полным каталогом растений
Author: Завод ФЛОРА
Author URI: https://zavodflora.com
Template: storefront
Version: 3.2.1
Text Domain: storefront-flora-child
*/

/* ===== БАЗОВЫЕ СТИЛИ FLORA ===== */
.flora-header-stats {
    display: flex;
    gap: 30px;
    justify-content: flex-end;
    padding: 10px 0;
}

.flora-header-stats .stat-item {
    text-align: center;
}

.flora-header-stats .stat-number {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #2e7d32;
}

.flora-header-stats .stat-label {
    font-size: 12px;
    color: #666;
}

/* ===== УЛУЧШЕНИЯ ДЛЯ КАТАЛОГА С ФИЛЬТРАМИ ===== */
.flora-filtered-catalog {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.flora-filter-panel {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.flora-filter-section {
    margin-bottom: 25px;
}

.flora-filter-section:last-child {
    margin-bottom: 0;
}

.flora-filter-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2e7d32;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flora-filter-title::before {
    content: "🌿";
    font-size: 20px;
}

/* ===== ПОИСК РАСТЕНИЙ ===== */
.flora-plant-search {
    position: relative;
    margin-bottom: 20px;
}

.flora-plant-search input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

.flora-plant-search input:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.flora-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
}

.flora-search-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.flora-search-item:hover {
    background: #f8f9fa;
}

.flora-search-item:last-child {
    border-bottom: none;
}

.flora-search-item strong {
    color: #2e7d32;
}

.flora-search-count {
    color: #666;
    font-size: 14px;
    margin-left: 10px;
}

/* ===== КНОПКИ ФИЛЬТРОВ ===== */
.flora-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.flora-filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    color: #333;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

.flora-filter-btn:hover {
    border-color: #4caf50;
    color: #4caf50;
    transform: translateY(-1px);
}

.flora-filter-btn.active {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.flora-filter-btn.secondary {
    border-color: #17a2b8;
}

.flora-filter-btn.secondary:hover,
.flora-filter-btn.secondary.active {
    background: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.flora-filter-btn.tertiary {
    border-color: #6c757d;
}

.flora-filter-btn.tertiary:hover,
.flora-filter-btn.tertiary.active {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* ===== КАРТОЧКИ РАСТЕНИЙ - ИСПРАВЛЕННЫЕ СТИЛИ v3.2.1 ===== */
.flora-plant-card {
    transition: all 0.3s ease !important;
    position: relative;
    z-index: 1;
}

/* Состояние по умолчанию для невыбранных карточек */
.flora-plant-card:not([data-selected="true"]) {
    background: white !important;
    transform: scale(1) !important;
}

/* Hover только для невыбранных карточек */
.flora-plant-card:not([data-selected="true"]):hover {
    background: #f8fff9 !important;
    border-color: #4caf50 !important;
    transform: translateY(-2px) scale(1.01) !important;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2) !important;
    z-index: 10;
}

/* При уходе мыши - принудительный сброс стилей */
.flora-plant-card:not([data-selected="true"]):not(:hover) {
    background: white !important;
    border-color: #dee2e6 !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

/* Стили для выбранной карточки */
.flora-plant-card[data-selected="true"] {
    cursor: default;
    pointer-events: none;
}

/* Контейнер для предотвращения влияния на соседние элементы */
details[open] > div {
    position: relative;
    z-index: 1;
}

/* Hover для кнопки "Показать все растения" */
.flora-summary-toggle {
    transition: all 0.3s ease !important;
}

.flora-summary-toggle:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
    border-color: #4caf50 !important;
    transform: translateY(-1px);
}

/* Сброс стилей при закрытии details */
details:not([open]) .flora-plant-card {
    background: white !important;
    transform: none !important;
}

/* ===== АКТИВНЫЕ ФИЛЬТРЫ ===== */
.flora-active-filters {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.flora-active-filters-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.flora-active-filter-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

.flora-clear-filters {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    transition: all 0.3s;
}

.flora-clear-filters:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
    color: white;
}

/* ===== РЕЗУЛЬТАТЫ ФИЛЬТРАЦИИ ===== */
.flora-results-info {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #4caf50;
}

.flora-results-count {
    font-size: 16px;
    font-weight: 600;
    color: #2e7d32;
}

.flora-results-description {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* ===== НЕТ РЕЗУЛЬТАТОВ ===== */
.flora-no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.flora-no-results-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.flora-no-results h2 {
    color: #666;
    margin-bottom: 15px;
}

.flora-no-results p {
    color: #888;
    margin-bottom: 25px;
    font-size: 16px;
}

.flora-no-results .button {
    background: #4caf50;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.flora-no-results .button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

/* ===== АЛФАВИТНАЯ НАВИГАЦИЯ ===== */
.flora-alphabet-nav {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    text-align: center;
}

.flora-alphabet-nav h4 {
    margin-bottom: 15px;
    color: #2e7d32;
    font-size: 18px;
}

.flora-alphabet-letter {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    margin: 3px;
    background: #f8f9fa;
    border-radius: 50%;
    text-decoration: none;
    color: #495057;
    font-weight: bold;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.flora-alphabet-letter:hover {
    background: #4caf50;
    color: white;
    transform: scale(1.1);
    text-decoration: none;
}

.flora-alphabet-letter.active {
    background: #2e7d32;
    color: white;
    border-color: #1b5e20;
}

/* ===== ГРУППИРОВКА ПО БУКВАМ ===== */
.flora-letter-group {
    margin-bottom: 40px;
}

.flora-letter-title {
    font-size: 24px;
    font-weight: bold;
    color: #2e7d32;
    border-bottom: 3px solid #4caf50;
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flora-letter-count {
    font-size: 16px;
    font-weight: normal;
    color: #666;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    .flora-header-stats {
        justify-content: center;
        padding: 5px 0;
        gap: 20px;
    }
    
    .flora-header-stats .stat-number {
        font-size: 16px;
    }
    
    .flora-filtered-catalog {
        padding: 15px;
    }
    
    .flora-filter-panel {
        padding: 20px 15px;
    }
    
    .flora-filter-buttons {
        gap: 6px;
    }
    
    .flora-filter-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .flora-active-filters {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .flora-clear-filters {
        align-self: center;
    }
    
    .flora-plant-search input {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .flora-plant-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .flora-plant-card-header {
        padding: 15px;
    }
    
    .flora-plant-emoji {
        font-size: 36px;
    }
    
    .flora-plant-name {
        font-size: 16px;
    }
    
    .flora-alphabet-letter {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 14px;
        margin: 2px;
    }
    
    .flora-letter-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .flora-plant-cards {
        grid-template-columns: 1fr;
    }
    
    .flora-alphabet-nav {
        padding: 15px;
    }
    
    .flora-filter-panel {
        padding: 15px;
    }
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flora-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.flora-plant-card {
    animation: fadeInUp 0.4s ease-out backwards;
    animation-delay: calc(var(--index) * 0.05s);
}

/* ===== УТИЛИТЫ ===== */
.flora-text-center {
    text-align: center;
}

.flora-mb-0 {
    margin-bottom: 0 !important;
}

.flora-mb-1 {
    margin-bottom: 0.5rem !important;
}

.flora-mb-2 {
    margin-bottom: 1rem !important;
}

.flora-mb-3 {
    margin-bottom: 1.5rem !important;
}

.flora-text-muted {
    color: #666 !important;
}

.flora-text-success {
    color: #28a745 !important;
}

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

.flora-visible {
    display: block !important;
}

/* ===== УЛУЧШЕНИЯ ПРОИЗВОДИТЕЛЬНОСТИ ===== */
.flora-lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

.flora-lazy-load.loaded {
    opacity: 1;
}

/* ===== ACCESSIBILITY ===== */
.flora-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== PRINT STYLES ===== */
@media print {
    .flora-filter-panel,
    .flora-alphabet-nav,
    .flora-active-filters {
        display: none;
    }
    
    .flora-plant-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}