/* =========================================
   CSS ЗМІННІ (ПІДТРИМКА ТЕМ)
   ========================================= */
:root {
    --bg-main: #f4f9fd;
    --bg-header: rgba(255, 255, 255, 0.95);
    --text-main: #2c3e50;
    --text-muted: #6c7a89;
    --card-bg: #ffffff;
    --accent: #2ecc71;
    --accent-hover: #27ae60;
    --accent-blue: #3498db;
    --border: #e0e7eb;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
    --hero-overlay: rgba(0,0,0,0.55);
    --footer-bg: #1a2a3a;
    --footer-text: #ecf0f1;
    --sale-bg: #e74c3c;
    --whatsapp: #25D366;
    --viber: #7360f2;
    --telegram: #26A5E4;
    --bottom-nav-bg: rgba(255, 255, 255, 0.95);
}

body.dark-mode {
    --bg-main: #121826;
    --bg-header: #1a2332;
    --text-main: #eef2f5;
    --text-muted: #9aaebf;
    --card-bg: #1e2a3a;
    --border: #2d3e50;
    --shadow: 0 4px 15px rgba(0,0,0,0.2);
    --hero-overlay: rgba(0,0,0,0.75);
    --footer-bg: #0a1118;
    --bottom-nav-bg: #1a2332;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-bottom: 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========= ШАПКА (ФІКСОВАНА) ========= */
header {
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

main {
    margin-top: 75px;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 12px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
}

.logo-text .blue { 
    background: linear-gradient(180deg, #ffffff 0%, #2c7be5 60%, #1a5bb5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.logo-text .orange { 
    background: linear-gradient(180deg, #ffffff 0%, #f39c12 60%, #e67e22 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ========= ТЕЛЕФОНИ ========= */
.phones {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.phone-link {
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    white-space: nowrap;
}

.phone-link:hover {
    color: var(--accent-blue);
}

/* ========= ПОШУК ========= */
.search-container {
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    transition: all 0.3s ease;
}

.search-input {
    width: 100%;
    padding: 8px 14px;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

/* ========= НАВІГАЦІЯ (десктоп) ========= */
.desktop-nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
    flex-wrap: nowrap;
}

.desktop-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
}

.desktop-nav a:hover { color: var(--accent); }

/* ========= КНОПКИ ДІЙ ========= */
.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.theme-toggle, .cart-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
    transition: all 0.2s;
}

.cart-icon {
    background: var(--accent);
    color: white;
    border: none;
    font-weight: bold;
}

/* ========= НИЖНЯ ПАНЕЛЬ ========= */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bottom-nav-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 8px 20px;
    z-index: 999;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-muted);
    transition: all 0.2s;
    padding: 5px 10px;
    border-radius: 30px;
}

.nav-item.active {
    color: var(--accent);
}

.nav-icon {
    font-size: 22px;
}

.nav-label {
    font-size: 9px;
}

.mobile-cart {
    position: relative;
}

.mobile-cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--sale-bg);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ========= ГЕРОЙ ========= */
.hero {
    position: relative;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--hero-overlay);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    padding: 40px 20px;
}

.hero-content h1 {
    font-size: 36px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 16px;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.btn-catalog {
    background: var(--accent);
    color: white;
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    display: inline-block;
    transition: transform 0.2s, background 0.2s;
}

.btn-catalog:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.sound-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 3;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    border: 1px solid white;
    border-radius: 50px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: white;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========= ФІЛЬТРИ ========= */
.filters-section {
    padding: 30px 0 20px;
}

.filters-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 30px;
}

.filter-group {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 6px 18px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
}

.filter-group.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ========= КАТЕГОРІЇ (виправлені картинки) ========= */
.categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.cat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 85px;
}

/* Фонові зображення для категорій - використовуємо background-image */
.cat-card[data-cat="1"] { background-image: url('../images/Cat/3.webp'); background-size: cover; background-position: center; }
.cat-card[data-cat="2"] { background-image: url('../images/Cat/6.webp'); background-size: cover; background-position: center; }
.cat-card[data-cat="3"] { background-image: url('../images/Cat/8.webp'); background-size: cover; background-position: center; }
.cat-card[data-cat="4"] { background-image: url('../images/Cat/2.webp'); background-size: cover; background-position: center; }
.cat-card[data-cat="5"] { background-image: url('../images/Cat/5.webp'); background-size: cover; background-position: center; }
.cat-card[data-cat="6"] { background-image: url('../images/Cat/7.webp'); background-size: cover; background-position: center; }
.cat-card[data-cat="7"] { background-image: url('../images/Cat/4.webp'); background-size: cover; background-position: center; }
.cat-card[data-cat="8"] { background-image: url('../images/Cat/1.webp'); background-size: cover; background-position: center; }

.cat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    transition: background 0.3s ease;
    z-index: 0;
}

.cat-card:hover::before {
    background: rgba(0,0,0,0.2);
}

.cat-card > * {
    position: relative;
    z-index: 1;
}

.cat-card:hover {
    transform: translateY(-3px);
}

.cat-text h3 {
    font-size: 14px;
    margin-bottom: 3px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.cat-text p {
    font-size: 10px;
    color: rgba(255,255,255,0.8);
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.cat-emoji {
    font-size: 36px;
    min-width: 45px;
    text-align: center;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
}

.cat-card:hover .cat-emoji {
    opacity: 1;
    transform: scale(1.05);
}

/* ========= ТОВАРИ ========= */
.section-title {
    font-size: 24px;
    margin: 30px 0 15px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 6px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.product-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.sale-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--sale-bg);
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 12px;
    margin-right: 6px;
}

.current-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent);
}

.product-img {
    width: 100px;
    height: 110px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--accent) 0%, transparent 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
}

.btn-buy {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 12px;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
}

/* ========= ФУТЕР ========= */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0 25px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.footer-grid a {
    color: var(--footer-text);
    text-decoration: none;
}

.social-icons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.social-icon {
    padding: 6px 14px;
    border-radius: 30px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

.social-icon.whatsapp { background: var(--whatsapp); }
.social-icon.viber { background: var(--viber); }
.social-icon.telegram { background: var(--telegram); }
.social-icon.fb { background: #1877f2; }
.social-icon.ig { background: #e4405f; }
.social-icon.tt { background: #000000; }

.copyright {
    text-align: center;
    padding-top: 20px;
}

/* ========= МОДАЛЬНІ ВІКНА ========= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-main);
}

.cart-total {
    font-size: 18px;
    font-weight: bold;
    margin-top: 15px;
}

.checkout-btn, .close-modal-btn {
    margin-top: 20px;
    padding: 10px 25px;
    background: var(--accent);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    width: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.contact-icon {
    font-size: 24px;
    min-width: 40px;
}

.contact-info {
    flex: 1;
}

.contact-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========= АДАПТИВ ========= */
@media (max-width: 1100px) {
    .desktop-nav {
        display: none;
    }
    
    .bottom-nav {
        display: flex;
    }
    
    body {
        padding-bottom: 60px;
    }
}

@media (max-width: 850px) {
    .header-flex {
        gap: 10px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .phone-link {
        font-size: 12px;
    }
    
    .theme-toggle, .cart-icon {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .search-container {
        min-width: 140px;
        max-width: 200px;
    }
    
    main {
        margin-top: 65px;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 24px;
    }
    
    .hero-content p {
        font-size: 14px;
    }
    
    .btn-catalog {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .filter-group {
        padding: 5px 14px;
        font-size: 12px;
    }
    
    .sound-btn {
        bottom: 10px;
        right: 10px;
        padding: 5px 12px;
        font-size: 11px;
    }
}

@media (max-width: 650px) {
    .phone-link {
        font-size: 11px;
    }
    
    .search-container {
        min-width: 110px;
        max-width: 160px;
    }
    
    .search-input {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 550px) {
    .logo-text {
        font-size: 14px;
    }
    
    .logo-img {
        height: 30px;
    }
    
    .phone-link {
        font-size: 10px;
    }
    
    .search-container {
        min-width: 90px;
        max-width: 130px;
    }
}