@import "product.css";
@import "navbar.css";
@import "cart.css";
@import "mini_navbar.css";

/* КЛЮЧ — убирает горизонтальный скролл */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Чтобы padding не ломал ширину */
* {
    box-sizing: border-box;
}

/* Контейнер логотипа */
.header .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Стили для изображения */
.header .logo img {
    max-width: 100%;
    height: auto;
    width: 450px;
}

/* Телефоны */
@media (max-width: 480px) {
    .header .logo img {
        width: 280px;
    }
}

.text {
    margin: 24px;
    display: flex;
    justify-content: center;
    font-size: 1.2rem;
    text-align: center;
    color: #000;
    text-decoration: none;
}

/* Продукты */
.products {
    justify-content: center;
    font-size: 1rem;
}

.category {
    display: flex;
    max-width: 70%;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 0 auto; /* добавлено */
}

#search-controls {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;

    margin: 0 auto !important;   /* убрали кривой margin */
    padding: 0 10px;
}

#search-controls * {
    text-align: center;
}

.category a {
    display: inline-block;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: none;
    color: #000;
}

.category a:hover {
    color: #007bff;
}

/* КАРТОЧКИ */
.products_card {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 20px;

    max-width: 1000px;
    margin: 0 auto;

    box-sizing: border-box;
}

.product_card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.product_card {
    width: 280px;
    flex-grow: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

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

.product_image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    margin-bottom: 15px;
}

.product_name_p {
    margin: 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    display: block;
    width: 100%;
    min-height: 2.4em;
    line-height: 1.2;
}

.product_real_price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    width: 100%;
}

.product_price {
    width: 60%;
    padding: 12px 0;
    background-color: #000;
    color: #fff;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
}

.product_price:hover {
    background-color: #333;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .product_card {
        width: 90%;
    }

    .product_image {
        height: auto;
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 900px) {

    .category {
        max-width: 100% !important;
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 0 15px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    .category a {
        font-size: 14px !important;
        text-align: center;
        flex-grow: 0;
        white-space: nowrap;
    }

    /* фикс переполнения */
    .products_card {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 10px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .product_card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 5px !important;
        box-sizing: border-box !important;
    }
}

.category-btn.active,
.category a.active {
    color: #fff;
    background-color: #333;
    border-radius: 4px;
    padding: 2px 8px;
}

/* Кнопка загрузки */
.button-container {
    display: flex;
    justify-content: center;
    padding: 40px 0;
    width: 100%;
}

#load-more {
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 12px 35px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

#load-more:hover {
    background-color: #fff;
    color: #000;
}

#load-more:disabled {
    background-color: #f4f4f4;
    color: #999;
    border-color: #ddd;
    cursor: not-allowed;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

html.no-scroll,
body.no-scroll {
    overflow: hidden !important;
    height: 100%;
}