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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: #1a1a1a;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.3s;
}

nav a:hover, nav a.active {
    color: #ff6b6b;
}

main {
    flex: 1;
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 20px;
    width: 100%;
}

h1 {
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    font-size: 2rem;
}

p {
    margin-bottom: 1rem;
}

.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1516035069371-29a1b244cc32?auto=format&fit=crop&w=1200&q=80') no-repeat center center/cover;
    color: white;
    padding: 5rem 2rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
    margin-top: 1rem;
}

.btn:hover {
    background: #fa5252;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

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

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    height: 120px;
}

footer {
    background: #1a1a1a;
    color: #aaa;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}
/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ff6b6b;
}

@keyframes zoomIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

/* Указатель для кликабельных картинок в каталоге */
.card img {
    cursor: pointer;
    transition: transform 0.3s;
}

.card img:hover {
    transform: scale(1.03);
}
/* Стили для кнопок фильтрации */
.filter-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: #e9ecef;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s, color 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background: #ff6b6b;
    color: white;
}

/* Стили для модального окна (если вы уже добавляли, оставьте их) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ff6b6b;
}

.card img {
    cursor: pointer;
    transition: transform 0.3s;
}

.card img:hover {
    transform: scale(1.03);
}
/* Стили для страницы товара */
.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .product-container {
        grid-template-columns: 1fr;
    }
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.thumbnails {
    display: flex;
    gap: 10px;
}

.thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.2s;
    border: 2px solid transparent;
}

.thumb:hover, .thumb.active {
    opacity: 1;
    border-color: #ff6b6b;
}

.product-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.product-price {
    font-size: 1.75rem;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 1.5rem;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.specs-table th, .specs-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.specs-table th {
    background: #f1f3f5;
    color: #333;
    width: 40%;
}

.specs-table tr:last-child td {
    border-bottom: none;
}
/* Стили для иконки корзины в шапке */
.cart-btn-header {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.3s;
}

.cart-btn-header:hover {
    background: #fa5252;
}

.cart-badge {
    background: white;
    color: #ff6b6b;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Модальные окна корзины и оформления */
.modal-cart {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-cart.active {
    display: flex;
}

.modal-cart-content {
    background: white;
    width: 100%;
    max-width: 550px;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.75rem;
}

.cart-close {
    font-size: 1.8rem;
    cursor: pointer;
    color: #333;
}

.cart-close:hover {
    color: #ff6b6b;
}

.cart-items-list {
    overflow-y: auto;
    max-height: 40vh;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.cart-item-info h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.cart-item-price {
    color: #666;
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-item-controls button {
    background: #e9ecef;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.cart-item-controls button:hover {
    background: #ced4da;
}

.remove-item {
    color: #ff6b6b;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 10px;
}

.cart-total {
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.checkout-form .form-group {
    margin-bottom: 1rem;
}

.checkout-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.checkout-form input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.empty-cart-msg {
    text-align: center;
    color: #777;
    padding: 2rem 0;
}
/* Стили для кнопки гамбургера */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Анимация гамбургера в крестик при открытии */
.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Медиазапросы для мобильных устройств (ширина до 768px) */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    header nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: #1a1a1a;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
        transition: right 0.3s ease-in-out;
        z-index: 1000;
    }

    header nav.active {
        right: 0;
    }

    header nav a {
        margin-left: 0;
        font-size: 1.25rem;
    }
}
