/* --- Глобальные переменные и основные стили --- */
:root {
    --bg-main: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #000000;
    --text-secondary: #686868;
    --accent-primary: #e31e24; /* Основной акцентный цвет (красный) */
    --accent-gradient: linear-gradient(180deg, #fc5964, #e30615); /* Градиент для акцентов */
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
}

.font-heading {
    font-family: 'Roboto Slab', serif;
}

/* --- Стили для шапки сайта --- */
.header-top-bar {
    background-color: #151515;
}

.header-main {
    background-color: var(--bg-secondary);
}

.header-cats {
    background-color: #f5f5f5;
}

.sticky-nav {
    position: sticky;
    top: 112px;
    z-index: 30;
}

/* --- Слайдер --- */
.slider-container {
    height: 50vh;
    max-height: 450px;
}

.slider-item {
    transition: opacity 1s ease-in-out;
}

/* --- Карточка товара --- */
.card {
    background-color: var(--bg-secondary);
    border-radius: 1.5rem; /* 24px */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.card_photo {
    border-radius: 1.5rem;
    background-color: #f6f6f6;
}

.card_attrs_promote {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
    height: 2rem;
}

.card_submit_incart {
    align-items: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    color: var(--text-primary);
}

.card_submit_incart strong {
    align-items: center;
    background: var(--accent-gradient);
    border: 6px solid #fbfbfb;
    border-radius: 50%;
    color: #fff;
    display: flex;
    font-size: 20px;
    height: 54px;
    justify-content: center;
    margin-left: 9px;
    width: 54px;
    transition: transform 0.2s ease;
}

.card_submit_incart:hover strong {
    transform: scale(1.08);
}

.card_submit_price del {
    color: #b7b7b7;
    font-size: 14px;
}

.card_submit_price strong {
    font-size: 24px;
    font-weight: 500;
}

/* --- Кнопки категорий --- */
.tag-btn {
    background-color: #f5f5f5;
    border-radius: 0.625rem; /* 10px */
    color: #000;
    cursor: pointer;
    padding: 0.5rem 1.5rem; /* 8px 24px */
    transition: all 0.2s;
    white-space: nowrap;
}

.tag-btn.active, .tag-btn:hover {
    background-color: var(--accent-primary);
    color: #fff;
}

/* --- Модальные окна --- */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Удаляем position: relative с .modal-content, если он был, т.к. теперь позиционируем относительно #modalOverlay */
/* Если modal-content не используется как родитель для позиционирования, его position: relative не нужен */
.modal-content {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    /* position: relative;  <-- УДАЛИТЬ ЭТУ СТРОКУ, если она тут была */
}

/* Style for the image within ingredient-item-modal */
.ingredient-item-modal img, .product-modal .flex-col.items-center img {
    border: 2px solid #dc2626;
}

/* NEW: Стили для кнопки закрытия модального окна */
.modal-close-btn {
    /* Базовые стили для мобильной версии (позиция фиксирована относительно viewport) */
    position: fixed; 
    top: 15px;
    right: 15px;
    z-index: 51; 
    
    background-color: #ef4444; 
    color: white;
    font-size: 2.5rem; 
    line-height: 1;
    padding: 0px 12px; 
    border: none;
    border-radius: 9999px; 
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s, transform 0.2s;
    display: flex; 
    align-items: center;
    justify-content: center;
    width: 48px; 
    height: 48px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
}

.modal-close-btn:hover {
    background-color: #dc2626; 
    opacity: 0.9;
    transform: scale(1.05); 
}

/* Медиа-запрос для десктопной версии (md breakpoint, 768px и выше) */
@media (min-width: 768px) {
    /* Чтобы кнопка позиционировалась относительно #modalOverlay, ему нужно быть position: relative; */
    /* Но #modalOverlay уже fixed, поэтому absolute внутри него будет работать относительно него. */
    /* УДАЛЯЕМ позиционирование с .p-6.pb-2.flex-shrink-0, т.к. теперь позиционируем относительно #modalOverlay */
    .modal-content .p-6.pb-2.flex-shrink-0 { /* Селектор для div с заголовком */
        /* position: relative; <-- УДАЛИТЕ ЭТУ СТРОКУ, если она была */
        padding-right: 20px; /* Верните нормальный паддинг или скорректируйте по вкусу */
    }

    .modal-close-btn {
        position: absolute; /* Теперь относительно #modalOverlay */
        top: calc(185px / 1080 * 100vh); /* NEW: Позиционирование по вертикали в vh */
        left: calc(1225px / 1920 * 100vw); /* NEW: Позиционирование по горизонтали в vw */
        
        background-color: black; 
        color: white;
        border: none; 
        box-shadow: none; 
        width: 36px; 
        height: 36px;
        font-size: 1.8rem; 
        padding: 0; 
        line-height: 1; 
        z-index: 52; 
    }
    .modal-close-btn:hover {
        background-color: #333; 
    }
}
/* style.css */
.text-xxs {
    font-size: 0.625rem; /* 10px при базовом 16px */
    /* Или, если text-xs это 0.75rem (12px), то 0.6875rem (11px) или 0.625rem (10px) */
}
.tag-btn { padding: 0.5rem 1.5rem; border-radius: 9999px; transition: all 0.2s; cursor: pointer; }
        .tag-btn.active { background-color: #dc2626; color: white; }
        .card {
            background-color: white;
            border-radius: 0.75rem;
            box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
            transition: transform 0.2s ease-in-out;
            display: flex;
            flex-direction: column;
        }
        .card:hover { transform: translateY(-5px); }
        .card-badge { position: absolute; top: 0.75rem; left: 0.75rem; height: 2rem; }
        .overflow-hidden-body { overflow: hidden; }

        /* Custom styles for subcategory display */
        .subcategory-container {
            margin-top: 1rem;
            padding-left: 1rem;
            border-top: 2px solid #e5e7eb; /* gray-200 */
        }
      .subcategory-btn {
       padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    background-color: #f3f4f6;
    color: #4b5563;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.1rem;
    margin-bottom: 0.5rem;
    display: inline-block;
        }
        .subcategory-btn:hover {
            background-color: #e5e7eb; /* gray-200 */
            color: #1f2937; /* gray-900 */
        }
        .subcategory-btn.active {
            background-color: #ef4444; /* red-500 */
            color: white;
        }
.card h3 {
    text-transform: uppercase; /* Добавлено для преобразования названий товаров в заглавные буквы */
}