/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Стили для шапки */
header {
    background: #fff;
    border-bottom: 3px solid #2980b9;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #2c3e50;
}

.logo-img {
    height: 40px;
    width: auto;
    margin-right: 8px;
}

.logo-text {
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
}

.header-contacts {
    text-align: right;
    flex-shrink: 0;
}

.header-contacts .phone {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    display: block;
}

.header-contacts .email {
    color: #7f8c8d;
    text-decoration: none;
    font-size: 12px;
}

/* ===== ГЛАВНАЯ НАВИГАЦИЯ - СИНЯЯ ===== */
.main-nav {
    background: #2980b9;  /* Синий цвет как у кнопок */
    border-radius: 4px;
    margin: 0;
    padding: 0;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.main-nav > ul > li {
    position: relative;
    display: inline-block;
}

.main-nav > ul > li > a {
    display: block;
    padding: 10px 16px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap;
}

.main-nav > ul > li > a:hover {
    background: #1a6a8f;  /* Темнее при наведении */
}

.main-nav > ul > li > a.nav-cart {
    background: #27ae60;  /* Зеленая корзина */
    border-radius: 4px;
}

.main-nav > ul > li > a.nav-cart:hover {
    background: #1e8449;
}

/* Выпадающее меню (если понадобится) */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 0 0 4px 4px;
    padding: 5px 0;
    z-index: 1000;
}

.dropdown-menu li {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 8px 20px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.3s;
}

.dropdown-menu li a:hover {
    background: #f0f0f0;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* Основной контент */
main {
    padding: 30px 0;
    min-height: 500px;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #f8f8f8;
    padding: 10px;
}

.product-card .product-info {
    padding: 15px;
}

.product-card h3 {
    font-size: 15px;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
}

.product-card h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.product-card .price {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
}

.product-card .button {
    display: inline-block;
    background: #2980b9;
    color: #fff;
    padding: 6px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.3s;
}

.product-card .button:hover {
    background: #1a6a8f;
}

/* Страница товара */
.product-page {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-page .product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.product-page .product-gallery img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.product-page .product-info .price {
    font-size: 26px;
    font-weight: bold;
    color: #e74c3c;
    margin: 15px 0;
}

.product-page .buy-button {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 20px;
}

.product-page .buy-button:hover {
    background: #1e8449;
}

/* Подвал */
footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 30px 0 15px;
    margin-top: 40px;
}

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

.footer-col h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #34495e;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 5px;
    font-size: 13px;
}

.footer-col ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: #fff;
}

.footer-col ul li strong {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 15px;
    text-align: center;
    font-size: 13px;
    color: #bdc3c7;
}

.footer-bottom p {
    margin: 3px 0;
}

/* Мобильные устройства */
@media (max-width: 1024px) {
    .main-nav > ul > li > a {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
        padding: 8px 0;
    }
    
    .header-contacts {
        text-align: center;
        margin-top: 5px;
    }
    
    .header-contacts .phone {
        font-size: 14px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .logo-img {
        height: 30px;
    }
    
    .main-nav {
        border-radius: 0;
        overflow: hidden;
    }
    
    .main-nav > ul {
        flex-direction: column;
    }
    
    .main-nav > ul > li > a {
        padding: 10px 15px;
        border-bottom: 1px solid #1a6a8f;
    }
    
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: #1a6a8f;
        border-radius: 0;
    }
    
    .dropdown-menu li a {
        color: #ecf0f1;
        padding-left: 30px;
        font-size: 13px;
    }
    
    .dropdown-menu li a:hover {
        background: #2980b9;
    }
    
    .product-page .product {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
}

/* Кнопка для мобильного меню */
.mobile-menu-toggle {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block !important;
        background: #2980b9;
        color: #fff;
        border: none;
        padding: 10px 15px;
        font-size: 24px;
        cursor: pointer;
        width: 100%;
        text-align: left;
    }
    
    .mobile-menu-toggle:hover {
        background: #1a6a8f;
    }
    
    .main-nav ul {
        display: none !important;
    }
    
    .main-nav ul.open {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* Стили для корзины в шапке */
.cart-link {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    margin-top: 5px;
}

.cart-link:hover {
    background: #1e8449;
}

.cart-counter {
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    padding: 0 6px;
    font-size: 12px;
    margin-left: 5px;
    min-width: 20px;
    display: inline-block;
    text-align: center;
}

.nav-cart {
    background: #27ae60;
    border-radius: 4px;
}

.nav-cart:hover {
    background: #1e8449;
}

.nav-cart .cart-counter {
    background: #fff;
    color: #2c3e50;
}
