/* ===== ОБНОВЛЁННАЯ ШАПКА ===== */
header {
    background: #1a1a2e; /* тёмный, но не чёрный */
    padding: 12px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}
.logo-icon {
    color: #f39c12;
    margin-right: 4px;
}
.tagline {
    font-size: 14px;
    color: #bdc3c7;
    font-weight: 300;
    letter-spacing: 0.3px;
    background: rgba(255,255,255,0.08);
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Навигация */
nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}
nav ul li a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: 0.3s;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}
nav ul li a:hover,
nav ul li a.active {
    color: #f39c12;
    border-bottom-color: #f39c12;
}

/* Блок действий */
.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.btn-primary-header {
    background: #f39c12;
    color: #1a1a2e;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    white-space: nowrap;
}
.btn-primary-header:hover {
    background: #e67e22;
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5);
}

/* Корзина */
.cart-icon a {
    color: #fff;
    font-size: 22px;
    position: relative;
    text-decoration: none;
    transition: 0.3s;
}
.cart-icon a:hover {
    color: #f39c12;
}
.cart-count {
    position: absolute;
    top: -10px;
    right: -12px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* ===== Адаптив ===== */
@media (max-width: 992px) {
    .tagline {
        display: none; /* скрываем слоган на планшетах, чтобы не мешал */
    }
}
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        justify-content: center;
    }
    .logo-wrapper {
        flex: 1;
        justify-content: flex-start;
    }
    nav {
        order: 3;
        flex-basis: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    nav ul {
        gap: 12px;
        justify-content: flex-start;
    }
    .header-actions {
        gap: 10px;
    }
    .btn-primary-header {
        font-size: 13px;
        padding: 6px 14px;
    }
    .cart-icon a {
        font-size: 20px;
    }
    .tagline {
        display: none; /* на мобильных слоган убираем совсем */
    }
}
@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }
    .btn-primary-header {
        font-size: 12px;
        padding: 5px 12px;
    }
}
/* Кнопки категорий в фирменном стиле */
.filter-btn {
    padding: 10px 20px;
    border: 2px solid #2c3e50;
    background: transparent;
    border-radius: 30px;
    font-weight: 600;
    transition: 0.3s;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
}
.filter-btn.active,
.filter-btn:hover {
    background: #2c3e50;
    color: #fff;
    transform: scale(1.02);
}
/* Фильтр */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}
.filter-btn {
    padding: 8px 20px;
    border: 2px solid #2c3e50;
    background: transparent;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}
.filter-btn.active,
.filter-btn:hover {
    background: #2c3e50;
    color: #fff;
}

/* Карточка – действия */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.card-actions .btn {
    flex: 1;
    text-align: center;
    padding: 8px;
}
.add-to-cart-btn {
    background: #e67e22;
}
.add-to-cart-btn:hover {
    background: #d35400;
}

/* Уведомление */
.notification {
    font-size: 16px;
}
/* Burger menu */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}
.burger-menu span {
    display: block;
    width: 28px;
    height: 3px;
    background: #fff;
    transition: 0.3s;
}
.burger-menu.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger-menu.active span:nth-child(2) { opacity: 0; }
.burger-menu.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
    .burger-menu { display: flex; }
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 20px 0;
    }
    nav ul.active { display: flex; }
    .header-actions { gap: 15px; }
    .cart-count { top: -8px; left: -5px; }
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #fff;
}

.dark-theme {
    background-color: #1a1a2e;
    color: #eee;
}
.dark-theme header { background: #16213e; }
.dark-theme .product-card { background: #2a2a3e; }
.dark-theme .btn { background: #e67e22; }

/* Toast */
.toast-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
}
.toast-container.top-right { top: 20px; right: 20px; }
.toast-container.bottom-right { bottom: 20px; right: 20px; }

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #333;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateX(30px);
    transition: 0.3s ease;
    min-width: 250px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.hide { opacity: 0; transform: translateX(30px); }
.toast-success { background: #28a745; }
.toast-error { background: #dc3545; }
.toast-warning { background: #ffc107; color: #333; }
.toast-info { background: #17a2b8; }
.toast-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

/* Анимации */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Кнопка "Загрузить ещё" */
.load-more-wrapper { text-align: center; margin: 30px 0; }
.load-more-btn { padding: 12px 40px; }

/* Спиннер загрузки */
.loading-spinner {
    text-align: center;
    padding: 30px;
    font-size: 18px;
    color: #888;
}
/* Контейнер изображения – фиксированное соотношение 3:2 */
.product-img-wrapper {
    width: 100%;
    padding-top: 66.67%; /* 200/300 = 66.67% */
    position: relative;
    background: #ecf0f1; /* фон на время загрузки */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Само изображение – вписано в контейнер с сохранением пропорций, центрировано */
.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* картинка вписывается целиком, не обрезается */
    display: block;
    margin: 0 auto; /* дополнительная страховка для центрирования */
}
/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
header {
    background: #2c3e50;
    color: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.logo a {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}

.logo span {
    color: #e67e22;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

nav ul li a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

nav ul li a:hover,
nav ul li a.active {
    color: #e67e22;
}

.cart-icon a {
    color: #fff;
    font-size: 20px;
    position: relative;
    text-decoration: none;
}

.cart-count {
    background: #e67e22;
    color: #fff;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 12px;
    position: relative;
    top: -10px;
    left: -8px;
}

/* Hero Banner */
.hero {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
    border-radius: 10px;
    margin: 30px 0;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 25px;
}

.btn {
    display: inline-block;
    background: #e67e22;
    color: #fff;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #d35400;
}

.btn-secondary {
    background: #34495e;
}

.btn-secondary:hover {
    background: #2c3e50;
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

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

/* Контейнер изображения – фиксированное соотношение 3:2 */
.product-img-wrapper {
    width: 100%;
    padding-top: 66.67%; /* 200/300 = 66.67% */
    position: relative;
    background: #ecf0f1; /* фон на время загрузки */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Само изображение – вписано в контейнер с сохранением пропорций, центрировано */
.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* картинка вписывается целиком, не обрезается */
    display: block;
    margin: 0 auto; /* дополнительная страховка для центрирования */
}

.product-info {
    padding: 15px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.product-info .category {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.product-info .price {
    font-size: 22px;
    font-weight: 700;
    color: #e67e22;
    margin: 10px 0;
}

.product-info .short-desc {
    font-size: 14px;
    color: #555;
    flex: 1;
}

.product-info .btn {
    margin-top: 12px;
    text-align: center;
    padding: 10px;
}

/* Product detail */
.product-detail {
    display: flex;
    gap: 40px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.product-detail .image {
    flex: 1 1 300px;
}

.product-detail .image img {
    width: 100%;
    border-radius: 10px;
}

.product-detail .info {
    flex: 2 1 400px;
}

.product-detail .info h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.product-detail .info .price {
    font-size: 28px;
    color: #e67e22;
    margin: 15px 0;
}

.product-detail .info .full-desc {
    margin: 20px 0;
    line-height: 1.8;
}

/* Cart & Checkout */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cart-table th {
    background: #ecf0f1;
}

.cart-table input[type="number"] {
    width: 60px;
    padding: 5px;
}

.cart-total {
    font-size: 24px;
    font-weight: 700;
    text-align: right;
    margin: 20px 0;
}

.checkout-form {
    max-width: 600px;
    margin: 30px 0;
}

.checkout-form label {
    display: block;
    margin-top: 15px;
    font-weight: 600;
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 5px;
}

.checkout-form .btn {
    margin-top: 20px;
    width: 100%;
}

/* Footer */
footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0 20px;
    margin-top: 60px;
}

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

.footer-grid h4 {
    color: #e67e22;
    margin-bottom: 15px;
}

.footer-grid ul {
    list-style: none;
}

.footer-grid ul li {
    margin-bottom: 8px;
}

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

.footer-grid ul li a:hover {
    color: #e67e22;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    margin-top: 30px;
    border-top: 1px solid #34495e;
    font-size: 14px;
    color: #bdc3c7;
}

/* Responsive */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    nav ul {
        justify-content: center;
    }
    .hero h1 {
        font-size: 28px;
    }
    .product-detail {
        flex-direction: column;
    }
    .cart-table {
        font-size: 14px;
    }
    .cart-table input[type="number"] {
        width: 50px;
    }
}
@media (max-width: 768px) {
    /* Шапка – фиксированная */
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #2c3e50;
        padding: 8px 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    .header-inner {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap !important;
        gap: 10px;
    }

    .logo a {
        font-size: 20px;
        white-space: nowrap;
    }

    /* Горизонтальное меню с прокруткой */
    nav {
        flex: 1;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        /* скрываем скроллбар для красоты */
        white-space: nowrap;
    }
    nav::-webkit-scrollbar {
        display: none;
    }

    nav ul {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 10px;
        list-style: none;
        margin: 0;
        padding: 0;
        white-space: nowrap;
    }

    nav ul li {
        display: inline-block; /* или flex-shrink: 0; */
        flex-shrink: 0;        /* не даём сжиматься */
    }

    nav ul li a {
        font-size: 14px;
        padding: 6px 10px;
        color: #ecf0f1;
        text-decoration: none;
        white-space: nowrap !important;
        display: inline-block;
    }

    /* Корзина в шапке – всегда видна */
    .cart-icon a {
        font-size: 24px;
        margin-left: 5px;
        white-space: nowrap;
    }
    .cart-count {
        font-size: 13px;
        padding: 2px 8px;
        top: -12px;
        left: -6px;
    }

    /* Остальные адаптивные стили (герой, сетка, карточки, фильтр, корзина) оставляем как есть */
    /* ... */
}