/* style.css - Стили для Korist.rs */

/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #F9FAFB;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Контейнер */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2E8B57 0%, #3CB371 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(46, 139, 87, 0.2);
}

.header-content {
    text-align: center;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Controls */
.controls {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #E5E7EB;
}

.control-group {
    margin-bottom: 1rem;
    text-align: center;
}

.control-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 1rem;
}

.select-wrapper {
    position: relative;
    display: inline-block;
    min-width: 200px;
}

.city-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #2E8B57;
    border-radius: 8px;
    background-color: white;
    color: #1F2937;
    appearance: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.city-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.2);
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #2E8B57;
    pointer-events: none;
    font-size: 0.8rem;
}

/* Категории */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.category-btn {
    padding: 0.75rem 1rem;
    background: #F3F4F6;
    border: 2px solid #D1D5DB;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
}

.category-btn:hover {
    background: #E5E7EB;
    border-color: #9CA3AF;
}

.category-btn.active {
    background: #2E8B57;
    color: white;
    border-color: #2E8B57;
}

/* Сортировка */
.sorting {
    margin: 1.5rem 0;
    text-align: center;
}

.sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.sort-btn {
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid #2E8B57;
    border-radius: 8px;
    color: #2E8B57;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s;
    min-height: 48px;
}

.sort-btn:hover {
    background: #2E8B57;
    color: white;
}

.sort-btn.active {
    background: #2E8B57;
    color: white;
}

/* Поиск */
.search-box {
    position: relative;
    max-width: 500px;
    margin: 1.5rem auto 0;
}

.search-input {
    width: 100%;
    padding: 0.9rem 3rem 0.9rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #D1D5DB;
    border-radius: 8px;
    background: white;
    color: #1F2937;
    transition: all 0.2s;
    min-height: 48px;
}

.search-input:focus {
    outline: none;
    border-color: #2E8B57;
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.2);
}

.search-input::placeholder {
    color: #9CA3AF;
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.search-clear:hover {
    color: #374151;
}

/* Products Grid */
.main {
    flex: 1;
    padding: 2rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.discount-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: #FF6B35;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.product-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #F9FAFB;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    flex: 1;
}

.product-store {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6B7280;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}



.store-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.store-name {
    font-weight: 500;
    color: #6B7280;
} 
.store-icon {
    font-size: 1rem;
}

.product-prices {
    margin: 0.75rem 0;
}

.old-price {
    font-size: 1rem;
    color: #9CA3AF;
    text-decoration: line-through;
    margin-bottom: 0.25rem;
}

.new-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2E8B57;
}

.product-weight {
    color: #6B7280;
    font-size: 0.9rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #F3F4F6;
}

.product-category {
    margin-top: 0.75rem;
    font-size: 1.5rem;
    text-align: right;
}

/* Результаты */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    border: 2px dashed #E5E7EB;
}

.no-results p {
    font-size: 1.2rem;
    color: #6B7280;
    margin-bottom: 1rem;
}

.results-count {
    text-align: center;
    padding: 1rem;
    color: #6B7280;
    font-size: 1.1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    margin-top: 1rem;
}

.results-count strong {
    color: #2E8B57;
}

/* WhatsApp кнопка */
.whatsapp-fixed {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 1001;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #25D366;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: all 0.3s;
    min-height: 48px;
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Footer */
.footer {
    background: #1F2937;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.footer-note {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.5;
}

.footer-cities {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.city-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 1.5rem;
        margin-bottom: 0.1rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
    
    .header {
        padding: 0.5rem 0;
    }
    
    .controls {
        padding: 0.5rem 0;
    }
    
    .control-group {
        margin-bottom: 0.5rem;
    }
    
    .select-wrapper {
        min-width: 150px;
    }
    
    .city-select {
        padding: 0.6rem 2rem 0.6rem 0.8rem;
        font-size: 1rem;
    }
    
    .categories {
        margin: 0.5rem 0;
        gap: 0.25rem;
    }
    
    .category-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
        min-height: 36px;
        gap: 0.3rem;
    }
    
    .sorting {
        margin: 0.5rem 0;
    }
    
    .sort-buttons {
        gap: 0.25rem;
    }
    
    .sort-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
        min-height: 36px;
    }
    
    .search-box {
        margin: 0.5rem auto 0;
        max-width: 100%;
    }
    
    .search-input {
        padding: 0.6rem 2.5rem 0.6rem 0.8rem;
        font-size: 1rem;
        min-height: 40px;
    }
    
    .search-clear {
        right: 0.8rem;
        font-size: 1rem;
    }
    
    .main {
        padding: 1rem 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-info {
        padding: 0.8rem;
    }
    
    .product-name {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .product-store {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .old-price {
        font-size: 0.8rem;
    }
    
    .new-price {
        font-size: 1.1rem;
    }
    
    .product-weight {
        font-size: 0.8rem;
        padding-top: 0.3rem;
    }
    
    .product-category {
        margin-top: 0.5rem;
        font-size: 1.2rem;
    }
    
    .discount-badge {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
        top: 0.5rem;
        left: 0.5rem;
    }
    
    .whatsapp-fixed {
        bottom: 1rem;
        right: 0.5rem;
    }
    
    .whatsapp-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .category-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .sort-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .footer-cities {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .city-tag {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    animation: fadeIn 0.4s ease-out;
}

/* Улучшение доступности */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Фокус для клавиатуры */
:focus-visible {
    outline: 3px solid #2E8B57;
    outline-offset: 2px;
}

/* Утилитарные классы для JS */
.hidden {
    display: none !important;
}

.filtered-out {
    opacity: 0.3;
    transform: scale(0.95);
    pointer-events: none;
}

/* Загрузка */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 5rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #2E8B57;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(46, 139, 87, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Install PWA button */
.install-btn {
    position: fixed;
    bottom: 8rem;
    right: 1rem;
    background: #FF6B35;
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

