/* Глобальные стили */
:root {
    --primary-color: #e66d00;
    --secondary-color: #ffcc00;
    --dark-color: #333;
    --light-color: #f8f9fa;
    --text-color: #555;
}

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

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

.btn {
    background-color: var(--primary-color);
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn:hover {
    background-color: #d05c00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title h2:after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.section-title p {
    color: #777;
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Header Styles */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    width: 200px;
}

.logo a {
    display: block;
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    display: none;
    cursor: pointer;
    margin-right: 15px;
}

.menu-toggle svg {
    width: 28px;
    height: 28px;
    color: var(--dark-color);
}

#menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

#menu.close-btn {
    display: none;
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
    margin: 10px;
    cursor: pointer;
}

#menu li {
    margin-left: 25px;
}

#menu li a {
    color: var(--dark-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

#menu li a:hover {
    color: var(--primary-color);
}

#menu li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

#menu li a:hover:after {
    width: 100%;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    margin-left: 25px;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

#menu.show {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

#menu.show li {
    margin: 0;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

/* Mobile menu close button */
.menu-close {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
    z-index: 101;
}

/* Hero Section */
.hero {
    background: url('images/ballons.png'), linear-gradient(135deg, #ffcc00 0%, #e66d00 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Products Section */
.products {
    padding: 80px 0;
}

.categories-filter {
    margin-bottom: 30px;
}

/* Улучшенное меню категорий с правильными отступами */
.categories-filter .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 15px;
    margin: 0 -15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 #f8f9fa;
}

.categories-filter .btn-group::-webkit-scrollbar {
    height: 8px;
}

.categories-filter .btn-group::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.categories-filter .btn-group::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

.categories-filter .btn {
    margin: 0;
    flex: 1 0 auto;
    min-width: 120px;
    white-space: normal;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.9rem;
    line-height: 1.3;
}

/* На мобильных устройствах меню будет вертикальным с отступами */
@media (max-width: 768px) {
    .categories-filter .btn-group {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .categories-filter .btn {
        width: 100%;
    }
}

/* На очень маленьких экранах делаем одну колонку */
@media (max-width: 480px) {
    .categories-filter .btn-group {
        grid-template-columns: 1fr;
    }
    
    .categories-filter .btn {
        min-width: auto;
    }
}

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

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: relative;
}

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

.product-img {
    width: 100%;
    height: 300px;
    overflow: hidden;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

.product-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--dark-color);
    min-height: 48px; /* Примерно 2 строки текста */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-content p {
    color: #777;
    margin-bottom: 10px;
    min-height: 40px; /* Примерно 2 строки текста */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
    font-size: 1.1em;
    min-height: 28px; /* Фиксируем высоту для стабильности */
}

.btn {
    margin-top: auto;
}

.btn-secondary {
    background-color: #e9ecef;
    color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: #d4d4d4;
}

/* Улучшенные стили для адаптивности */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Фиксируем 2 колонки для планшетов */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-img {
        height: 180px;
    }
}

@media (max-width: 576px) {
    /* Фиксируем 1 колонку для мобильных телефонов */
    .products-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .product-img {
        height: 220px;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .logo {
        margin-bottom: 10px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    #menu {
        display: none;
        width: 100%;
    }
    
    #menu.show {
        display: block;
        position: static;
        box-shadow: none;
    }
    
    #menu li {
        width: 100%;
    }
}

/* Services Section */
.services {
    padding: 80px 0;
    background-color: var(--light-color);
}

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

.service-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

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

.service-img {
    height: 200px;
    overflow: hidden;
}

.service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card:hover .service-img img {
    transform: scale(1.1);
}

.service-content {
    padding: 20px;
}

.service-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.service-content p {
    color: #777;
    margin-bottom: 20px;
}

/* About Section */
.about {
    padding: 80px 0;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

/* Изменение для мобильных устройств - картинка над текстом */
@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-img {
        order: 1;
    }
    
    .about-text {
        order: 2;
    }
}

.about-img {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.about-img img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text h3 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.about-features {
    margin-top: 30px;
}

.feature {
    display: flex;
    margin-bottom: 20px;
}

.feature-icon {
    background-color: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

.feature-text h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--dark-color);
}

/* Map Section */
.map-section {
    padding: 80px 0;
    background-color: var(--light-color);
}

.map-container {
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Contact Section */
.contact {
    padding: 80px 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* Для мобильных устройств меняем порядок: сначала форма, потом контакты */
@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "form"
            "info";
    }
    
    .contact-info {
        grid-area: info;
    }
    
    .contact-form {
        grid-area: form;
    }
}

.contact-info h3 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 25px;
}

.contact-item {
    display: flex;
    margin-bottom: 20px;
}

.contact-icon {
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
}

.contact-text h4 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.contact-form {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.contact-form h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* Изменяем футер на мобильных устройствах */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-column {
        margin-bottom: 30px;
    }
    
    .footer-column:last-child {
        margin-bottom: 0;
    }
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
}

.footer-column p {
    color: #bbb;
    line-height: 1.8;
    margin-bottom: 20px;
}

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

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #bbb;
    transition: color 0.3s ease;
    display: block;
}

.footer-column ul li a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #444;
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #444;
    color: #bbb;
}

/* Product Modal */
.modal-content {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.modal-footer {
    background-color: #f8f9fa;
    border: none;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.cart-item {
    transition: all 0.3s ease;
}

.cart-item:hover {
    transform: scale(1.02);
}