/* Современная тема "Fresh" - основана на логотипе магазина */
/* Цветовая палитра: темно-зеленый, средний зеленый, светло-зеленый, белый */

/* ===== CSS ПЕРЕМЕННЫЕ ===== */
:root {
    --fresh-dark-green: #1a4d0f;
    --fresh-medium-green: #4a7c2a;
    --fresh-light-green: #a8d5a0;
    --fresh-pale-green: #c4e6b8;
    --fresh-bg-light: #f0f8ec;
    --fresh-white: #ffffff;
    --fresh-text-dark: #1a1a1a;
    --fresh-text-medium: #4a4a4a;
    --fresh-border: #d4e8cc;
    --fresh-shadow: rgba(26, 77, 15, 0.1);
    --fresh-shadow-hover: rgba(26, 77, 15, 0.2);
}

/* ===== БАЗОВЫЕ СТИЛИ ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', Arial, sans-serif;
    background-color: var(--fresh-bg-light);
    color: var(--fresh-text-dark);
    line-height: 1.6;
}

/* ===== НАВИГАЦИЯ ===== */
.navbar {
    background: var(--fresh-white) !important;
    box-shadow: 0 2px 15px var(--fresh-shadow);
    border-bottom: 2px solid var(--fresh-light-green);
    padding: 1.5rem 0;
    min-height: 100px;
    align-items: flex-start;
}

.navbar-brand {
    font-weight: 700;
    color: var(--fresh-dark-green) !important;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 170px;
}

/* Логотип магазина через CSS псевдоэлемент */
/* Путь: assets/themes/fresh/ -> assets/themes/ -> assets/ -> assets/images/logo.png */
.navbar-brand::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-30%);
    width: 150px;
    height: 150px;
    /* Используем абсолютный путь от корня сайта */
    background-image: url('/assets/images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
    background-color: var(--fresh-white);
    padding: 8px;
    box-shadow: 0 2px 8px var(--fresh-shadow);
    transition: all 0.3s ease;
    z-index: 1;
    display: block;
}

/* Если логотип добавлен через HTML img, скрываем ::before и корректируем отступ */
.navbar-brand img[src*="logo"],
.navbar-brand img.store-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-30%);
    height: 150px;
    width: 150px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--fresh-white);
    padding: 8px;
    box-shadow: 0 2px 8px var(--fresh-shadow);
    transition: all 0.3s ease;
    z-index: 1;
}

.navbar-brand:has(img[src*="logo"])::before,
.navbar-brand:has(img.store-logo)::before {
    display: none;
}

.navbar-brand:hover {
    color: var(--fresh-medium-green) !important;
}

.navbar-brand:hover::before,
.navbar-brand:hover img[src*="logo"],
.navbar-brand:hover img.store-logo {
    box-shadow: 0 4px 12px var(--fresh-shadow-hover);
    transform: translateY(-30%) rotate(5deg) scale(1.05);
}

/* Скрываем иконку магазина, так как используем логотип */
.navbar-brand i.bi-shop {
    display: none;
}

@media (max-width: 576px) {
    .navbar-brand::before,
    .navbar-brand img[src*="logo"],
    .navbar-brand img.store-logo {
        width: 120px;
        height: 120px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
        padding-left: 140px;
        gap: 10px;
    }
}

.nav-link {
    color: var(--fresh-text-medium) !important;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.6rem 1.2rem !important;
    border-radius: 12px;
    margin: 0 0.3rem;
    background-color: transparent;
    border: 2px solid transparent;
    position: relative;
}

.nav-link:hover {
    color: var(--fresh-white) !important;
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%) !important;
    border-color: var(--fresh-medium-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--fresh-shadow-hover);
}

.nav-link.active {
    color: var(--fresh-white) !important;
    background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%) !important;
    border-color: var(--fresh-dark-green);
    box-shadow: 0 2px 8px var(--fresh-shadow);
}

.btn-outline-primary {
    border-color: var(--fresh-medium-green);
    color: var(--fresh-medium-green);
}

.btn-outline-primary:hover {
    background-color: var(--fresh-medium-green);
    border-color: var(--fresh-medium-green);
    color: var(--fresh-white);
}

.btn-primary {
    background-color: var(--fresh-medium-green);
    border-color: var(--fresh-medium-green);
    color: var(--fresh-white);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--fresh-dark-green);
    border-color: var(--fresh-dark-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--fresh-shadow-hover);
}

/* ===== ГЕРОЙ-СЕКЦИЯ ===== */
.hero-section {
    background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%);
    color: var(--fresh-white);
    padding: 35px 0;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 30px 30px;
}

/* Декоративные листья в фоне */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(168, 213, 160, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(196, 230, 184, 0.15) 0%, transparent 50%);
    opacity: 0.6;
}

.hero-title {
    font-weight: 800;
    margin-bottom: 20px;
    font-size: 3rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    color: #f0f8ec !important;
}

.hero-subtitle {
    font-size: 1.4rem;
    opacity: 0.95;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

/* Современная кнопка в hero-секции */
.hero-section .btn-light {
    background: linear-gradient(135deg, var(--fresh-white) 0%, var(--fresh-pale-green) 100%);
    color: var(--fresh-dark-green) !important;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(168, 213, 160, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hero-section .btn-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.hero-section .btn-light:hover::before {
    left: 100%;
}

.hero-section .btn-light:hover {
    background: linear-gradient(135deg, var(--fresh-pale-green) 0%, var(--fresh-white) 100%);
    color: var(--fresh-dark-green) !important;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(168, 213, 160, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-section .btn-light:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.hero-section .btn-light i {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
}

.hero-section .btn-light:hover i {
    transform: translateX(8px);
}

.hero-section .btn-light:active i {
    transform: translateX(4px);
}

/* ===== КАРТОЧКИ ТОВАРОВ ===== */
.product-card-link {
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.product-card {
    border: 2px solid var(--fresh-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    margin-bottom: 25px;
    background: var(--fresh-white);
    box-shadow: 0 2px 10px var(--fresh-shadow);
    cursor: pointer;
}

.product-card-link:hover .product-card {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px var(--fresh-shadow-hover);
    border-color: var(--fresh-medium-green);
}

.product-img,
.product-img-wrapper {
    height: 240px;
    width: 100%;
    object-fit: contain;
    background: linear-gradient(to bottom, var(--fresh-white) 0%, var(--fresh-bg-light) 100%);
    padding: 15px;
    border-bottom: 2px solid var(--fresh-border);
    transition: opacity 0.3s;
}

.product-img-main {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Новый стиль для галереи изображений */
.product-img-slides {
    pointer-events: none;
}

.product-img-slides img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-image-gallery:hover .product-img-main {
    opacity: 0.3;
    transition: opacity 0.5s ease-in-out;
}

/* Сохраняем обратную совместимость со старыми стилями */
.product-img-hover {
    position: absolute;
    top: 15px;
    left: 15px;
    width: calc(100% - 30px);
    height: calc(100% - 30px);
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-image-container:hover .product-img-hover {
    opacity: 1;
}

/* Скрываем главное изображение только если есть класс product-image-gallery (т.е. есть дополнительные изображения) */
.product-image-container.product-image-gallery:hover .product-img-main {
    opacity: 0.3;
    transition: opacity 0.5s ease-in-out;
}

/* Для страницы "Все товары" и категорий */
.product-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: linear-gradient(to bottom, var(--fresh-white) 0%, var(--fresh-bg-light) 100%);
    padding: 15px;
}

.product-card > div:first-child {
    background: linear-gradient(to bottom, var(--fresh-white) 0%, var(--fresh-bg-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

/* ===== КАРТОЧКИ КАТЕГОРИЙ ===== */
.category-card {
    text-align: center;
    padding: 30px 20px;
    border: 2px solid var(--fresh-border);
    border-radius: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--fresh-text-dark);
    display: block;
    background: var(--fresh-white);
    box-shadow: 0 2px 8px var(--fresh-shadow);
}

.category-card:hover {
    background: linear-gradient(135deg, var(--fresh-light-green) 0%, var(--fresh-pale-green) 100%);
    border-color: var(--fresh-medium-green);
    text-decoration: none;
    color: var(--fresh-dark-green);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--fresh-shadow-hover);
}

.category-icon {
    font-size: 50px;
    margin-bottom: 15px;
    color: var(--fresh-medium-green);
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

/* ===== БЕЙДЖИ ===== */
.stock-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1;
    border-radius: 20px;
    font-weight: 600;
    padding: 5px 12px;
}

.new-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1;
    background-color: var(--fresh-medium-green) !important;
    border-radius: 20px;
    font-weight: 600;
    padding: 5px 12px;
}

/* Стиль для рейтинга товара */
.product-rating-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #4a7c2a 0%, #5a9a35 100%);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(26, 77, 15, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.product-rating-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(26, 77, 15, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.product-rating-badge .rating-star {
    color: #ffd700 !important;
    font-size: 0.9rem !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6)) !important;
    display: inline-block !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    margin-right: 2px !important;
}

.product-rating-badge span:not(.rating-star) {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-success {
    background-color: var(--fresh-medium-green) !important;
}

.cart-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 11px;
    padding: 3px 7px;
    min-width: 22px;
    border-radius: 12px;
    background-color: var(--fresh-medium-green) !important;
}

/* ===== СТРАНИЦА ТОВАРА ===== */
.product-detail-image {
    width: 100%;
    max-height: 550px;
    height: auto;
    object-fit: contain;
    border-radius: 20px;
    background: linear-gradient(to bottom, var(--fresh-white) 0%, var(--fresh-bg-light) 100%);
    padding: 20px;
    box-shadow: 0 4px 15px var(--fresh-shadow);
}

.product-gallery-main {
    background: linear-gradient(to bottom, var(--fresh-white) 0%, var(--fresh-bg-light) 100%);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    box-shadow: 0 4px 15px var(--fresh-shadow);
}

.product-info-card {
    border-radius: 20px;
    box-shadow: 0 4px 20px var(--fresh-shadow);
    border: 2px solid var(--fresh-border);
    background: var(--fresh-white);
}

.price-badge {
    font-size: 2.8rem;
    padding: 20px 30px;
    color: #dc3545 !important;
    font-weight: 900;
    background-color: #ffffff !important;
    border: 2px solid var(--fresh-border);
    border-radius: 12px;
}

/* Переопределяем зеленый фон badge для цены */
.price-badge.badge.bg-success,
.badge.price-badge.bg-success {
    background-color: #ffffff !important;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-input {
    width: 80px;
    text-align: center;
    border: 2px solid var(--fresh-border);
    border-radius: 10px;
    padding: 10px;
    font-weight: 600;
}

.quantity-input:focus {
    border-color: var(--fresh-medium-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 124, 42, 0.1);
}

.specs-table td {
    padding: 12px;
    border-bottom: 1px solid var(--fresh-border);
}

.specs-table tr:last-child td {
    border-bottom: none;
}

.similar-product-card {
    border: 2px solid var(--fresh-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    background: var(--fresh-white);
    box-shadow: 0 2px 10px var(--fresh-shadow);
    cursor: pointer;
}

.product-card-link:hover .similar-product-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--fresh-shadow-hover);
    border-color: var(--fresh-medium-green);
}

.similar-product-image {
    height: 160px;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: linear-gradient(to bottom, var(--fresh-white) 0%, var(--fresh-bg-light) 100%);
    padding: 10px;
    border-bottom: 2px solid var(--fresh-border);
}

.section-header {
    border-bottom: 3px solid var(--fresh-medium-green);
    padding-bottom: 15px;
    margin-bottom: 25px;
    position: relative;
}

.section-header:after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 120px;
    height: 3px;
    background: var(--fresh-light-green);
    border-radius: 2px;
}

.recommendation-tabs {
    border-bottom: 2px solid var(--fresh-border);
}

.recommendation-tabs .nav-link {
    border: none;
    color: var(--fresh-text-medium);
    font-weight: 600;
    border-radius: 10px 10px 0 0;
    margin-right: 5px;
}

.recommendation-tabs .nav-link.active {
    color: var(--fresh-dark-green);
    border-bottom: 3px solid var(--fresh-medium-green);
    background: var(--fresh-light-green);
}

.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1;
}

/* ===== СТРАНИЦА КАТЕГОРИИ ===== */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--fresh-medium-green);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--fresh-dark-green);
    text-decoration: underline;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--fresh-text-dark);
}

.product-price {
    font-size: 28px;
    color: #dc3545 !important;
    font-weight: 900;
}

.old-price {
    text-decoration: line-through;
    color: var(--fresh-text-medium);
    font-size: 18px;
    margin-left: 10px;
}

.category-sidebar {
    position: sticky;
    top: 20px;
    background: var(--fresh-white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 10px var(--fresh-shadow);
    border: 2px solid var(--fresh-border);
}

.category-item {
    display: block;
    padding: 12px 18px;
    margin-bottom: 8px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--fresh-text-medium);
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-item:hover {
    background: linear-gradient(135deg, var(--fresh-light-green) 0%, var(--fresh-pale-green) 100%);
    color: var(--fresh-dark-green);
    text-decoration: none;
    transform: translateX(5px);
}

.category-item.active {
    background: var(--fresh-medium-green);
    color: var(--fresh-white);
    font-weight: 600;
}

/* ===== КНОПКА "В КОРЗИНУ" - СОВРЕМЕННЫЙ ДИЗАЙН ===== */
.btn-add-to-cart {
    width: 100%;
    border-radius: 25px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%);
    border: none;
    color: var(--fresh-white);
    box-shadow: 0 4px 15px var(--fresh-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-add-to-cart:hover::before {
    left: 100%;
}

.btn-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--fresh-shadow-hover);
    background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%);
}

.btn-add-to-cart:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--fresh-shadow);
}

.btn-add-to-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Стили для кнопок "в корзину" с классом btn-success */
.btn-success.btn-add-to-cart,
.btn-success[class*="cart"],
button.btn-success[onclick*="addToCart"],
form button.btn-success[type="submit"] {
    border-radius: 25px !important;
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%) !important;
    border: none !important;
    color: var(--fresh-white) !important;
    box-shadow: 0 4px 15px var(--fresh-shadow) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
}

.btn-success.btn-add-to-cart:hover,
.btn-success[class*="cart"]:hover,
button.btn-success[onclick*="addToCart"]:hover,
form button.btn-success[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px var(--fresh-shadow-hover) !important;
    background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%) !important;
}

/* Стили для кнопок "в корзину" с классом btn-primary */
.btn-primary.btn-add-to-cart,
.btn-primary[class*="cart"] {
    border-radius: 25px !important;
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%) !important;
    border: none !important;
    color: var(--fresh-white) !important;
    box-shadow: 0 4px 15px var(--fresh-shadow) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 600 !important;
}

.btn-primary.btn-add-to-cart:hover,
.btn-primary[class*="cart"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px var(--fresh-shadow-hover) !important;
    background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%) !important;
}

/* Стили для кнопок "в корзину" с классом btn-dark */
.btn-dark.btn-add-to-cart,
.btn-dark[class*="cart"] {
    border-radius: 25px !important;
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%) !important;
    border: none !important;
    color: var(--fresh-white) !important;
    box-shadow: 0 4px 15px var(--fresh-shadow) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 600 !important;
}

.btn-dark.btn-add-to-cart:hover,
.btn-dark[class*="cart"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px var(--fresh-shadow-hover) !important;
    background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%) !important;
}

.no-products {
    padding: 80px 30px;
    text-align: center;
    background: var(--fresh-white);
    border-radius: 20px;
    border: 2px solid var(--fresh-border);
    box-shadow: 0 2px 10px var(--fresh-shadow);
}

/* ===== СТРАНИЦА "ВСЕ ТОВАРЫ" ===== */
.filter-card {
    position: sticky;
    top: 20px;
    background: var(--fresh-white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 10px var(--fresh-shadow);
    border: 2px solid var(--fresh-border);
}

.pagination .page-link {
    border-radius: 10px;
    margin: 0 5px;
    border: 2px solid var(--fresh-border);
    color: var(--fresh-text-medium);
    font-weight: 500;
}

.pagination .page-link:hover {
    background-color: var(--fresh-light-green);
    border-color: var(--fresh-medium-green);
    color: var(--fresh-dark-green);
}

.pagination .page-item.active .page-link {
    background-color: var(--fresh-medium-green);
    border-color: var(--fresh-medium-green);
    color: var(--fresh-white);
}

.search-box {
    position: relative;
}

.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    border-radius: 0 10px 10px 0;
    background-color: var(--fresh-medium-green);
    border-color: var(--fresh-medium-green);
}

/* ===== СТИЛИ ДЛЯ ФИЛЬТРОВ КАТЕГОРИЙ (LIST-GROUP) ===== */
/* Заменяем синий цвет Bootstrap на цвета темы */
.list-group-item {
    border-color: var(--fresh-border);
    color: var(--fresh-text-medium);
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: var(--fresh-light-green);
    border-color: var(--fresh-medium-green);
    color: var(--fresh-dark-green);
    z-index: 1;
}

.list-group-item.active {
    background-color: var(--fresh-medium-green) !important;
    border-color: var(--fresh-medium-green) !important;
    color: var(--fresh-white) !important;
}

.list-group-item-action:focus {
    background-color: var(--fresh-light-green);
    border-color: var(--fresh-medium-green);
    color: var(--fresh-dark-green);
}

/* Стили для кнопки "Все категории" с иконкой */
.category-toggle-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.category-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.category-toggle-btn.active .category-toggle-icon {
    transform: rotate(180deg);
}

/* Обертка для списка категорий с плавной анимацией */
.categories-list-wrapper {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

.categories-list-wrapper[style*="display: block"] {
    max-height: 2000px;
    opacity: 1;
}

/* Мобильная версия - дополнительное выделение */
@media (max-width: 767.98px) {
    .list-group-item {
        border-radius: 10px;
        margin-bottom: 5px;
        padding: 12px 15px;
    }
    
    .list-group-item.active {
        background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%) !important;
        border-color: var(--fresh-dark-green) !important;
        color: var(--fresh-white) !important;
        font-weight: 600;
        box-shadow: 0 2px 8px var(--fresh-shadow);
    }
    
    .list-group-item:hover:not(.active) {
        background: linear-gradient(135deg, var(--fresh-light-green) 0%, var(--fresh-pale-green) 100%);
        transform: translateX(3px);
    }
}

/* Стили для живого поиска на главной странице */
.search-box-wrapper {
    position: relative;
    width: 100%;
}

.live-search-form .search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    font-size: 1.1rem;
    border: 3px solid var(--fresh-border);
    border-radius: 50px;
    background-color: var(--fresh-white);
    box-shadow: 0 4px 15px var(--fresh-shadow);
    transition: all 0.3s ease;
    color: var(--fresh-text-dark);
}

.live-search-form .search-input:focus {
    outline: none;
    border-color: var(--fresh-medium-green);
    box-shadow: 0 6px 25px var(--fresh-shadow-hover), 0 0 0 4px rgba(74, 124, 42, 0.1);
}

.live-search-form .search-input::placeholder {
    color: var(--fresh-text-medium);
    opacity: 0.7;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fresh-medium-green);
    font-size: 1.3rem;
    z-index: 2;
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--fresh-white);
    border-radius: 20px;
    box-shadow: 0 8px 30px var(--fresh-shadow-hover);
    border: 2px solid var(--fresh-border);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--fresh-border);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--fresh-text-dark);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: linear-gradient(135deg, var(--fresh-light-green) 0%, var(--fresh-pale-green) 100%);
    color: var(--fresh-dark-green);
    transform: translateX(5px);
}

.search-result-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 10px;
    background: var(--fresh-bg-light);
    padding: 5px;
}

.search-result-item .result-info {
    flex: 1;
}

.search-result-item .result-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.search-result-item .result-price {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.1rem;
}

.search-results .no-results {
    padding: 2rem;
    text-align: center;
    color: var(--fresh-text-medium);
}

.search-results .search-loading {
    padding: 2rem;
    text-align: center;
    color: var(--fresh-medium-green);
}

.search-results .search-loading i {
    animation: spin 1s linear infinite;
}

.form-control:focus {
    border-color: var(--fresh-medium-green);
    box-shadow: 0 0 0 3px rgba(74, 124, 42, 0.1);
}

/* ===== КОРЗИНА ===== */
.cart-container {
    min-height: calc(100vh - 200px);
}

.cart-item-image {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid var(--fresh-border);
    background: var(--fresh-bg-light);
    padding: 5px;
    flex-shrink: 0;
}

.quantity-control {
    display: flex;
    align-items: center;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--fresh-border);
    background: var(--fresh-white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--fresh-medium-green);
    font-weight: 600;
}

.quantity-btn:hover {
    background: var(--fresh-medium-green);
    color: var(--fresh-white);
    border-color: var(--fresh-medium-green);
}

.summary-card {
    position: sticky;
    top: 20px;
    border: 2px solid var(--fresh-border);
    border-radius: 20px;
    background: var(--fresh-white);
    box-shadow: 0 4px 15px var(--fresh-shadow);
    padding: 25px;
}

.empty-cart {
    text-align: center;
    padding: 80px 30px;
}

.empty-cart-icon {
    font-size: 5rem;
    color: var(--fresh-medium-green);
    margin-bottom: 25px;
    opacity: 0.6;
}

.mobile-cart-item {
    display: none;
}

/* ===== СТИЛИ КНОПОК В КОРЗИНЕ - МОБИЛЬНАЯ ВЕРСИЯ ===== */
@media (max-width: 767.98px) {
    /* Кнопка "Продолжить покупки" - современный стиль */
    .cart-container .btn-outline-secondary {
        border-radius: 25px !important;
        border: 2px solid var(--fresh-medium-green) !important;
        color: var(--fresh-medium-green) !important;
        background: transparent !important;
        font-weight: 600 !important;
        padding: 0.75rem 1.5rem !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 2px 8px rgba(74, 124, 42, 0.1) !important;
        position: relative;
        overflow: hidden;
    }
    
    .cart-container .btn-outline-secondary::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(74, 124, 42, 0.1), transparent);
        transition: left 0.5s;
    }
    
    .cart-container .btn-outline-secondary:hover::before {
        left: 100%;
    }
    
    .cart-container .btn-outline-secondary:hover {
        background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%) !important;
        border-color: var(--fresh-medium-green) !important;
        color: var(--fresh-white) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 15px var(--fresh-shadow-hover) !important;
    }
    
    .cart-container .btn-outline-secondary:active {
        transform: translateY(0) !important;
        box-shadow: 0 2px 8px rgba(74, 124, 42, 0.2) !important;
    }
    
    /* Кнопка "Очистить корзину" - современный стиль, красный цвет */
    .cart-container .btn-outline-danger {
        border-radius: 25px !important;
        border: 2px solid #dc3545 !important;
        color: #dc3545 !important;
        background: transparent !important;
        font-weight: 600 !important;
        padding: 0.75rem 1.5rem !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1) !important;
        position: relative;
        overflow: hidden;
    }
    
    .cart-container .btn-outline-danger::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }
    
    .cart-container .btn-outline-danger:hover::before {
        left: 100%;
    }
    
    .cart-container .btn-outline-danger:hover {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
        border-color: #dc3545 !important;
        color: var(--fresh-white) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3) !important;
    }
    
    .cart-container .btn-outline-danger:active {
        transform: translateY(0) !important;
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2) !important;
    }
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 0 6px 20px var(--fresh-shadow-hover);
    animation: slideIn 0.3s ease;
    border-radius: 16px;
    border: 2px solid var(--fresh-light-green);
    background: var(--fresh-white);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 11px;
    padding: 3px 8px;
}

/* ===== АНИМАЦИИ ===== */
.spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ОПТИМИЗАЦИЯ ИЗОБРАЖЕНИЙ ===== */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s;
}

img.loaded {
    opacity: 1;
}

/* ===== СТИЛИ ЦЕН НА КАРТОЧКАХ ТОВАРОВ ===== */
/* Цена в карточках товаров - только элементы с text-danger (цены), не названия */
.product-card .h5.text-danger,
.product-card h5.text-danger,
.product-card span.h5.text-danger,
.product-card span.text-danger.fw-bold,
.product-card .text-danger.fw-bold:not(.badge) {
    color: #dc3545 !important;
    font-weight: 900 !important;
    font-size: 1.6rem !important;
}

/* ===== ЕДИНЫЙ СТИЛЬ НАЗВАНИЙ ТОВАРОВ В КАРТОЧКАХ ===== */
/* Все названия товаров (h5.fw-bold) должны иметь единый стиль */
.product-card h5.fw-bold:not(.text-danger),
.product-card .h5.fw-bold:not(.text-danger),
.products-grid .product-card h5.fw-bold:not(.text-danger),
.products-grid .product-card .h5.fw-bold:not(.text-danger),
.product-card-link .product-card h5.fw-bold:not(.text-danger),
.product-card-link .product-card .h5.fw-bold:not(.text-danger) {
    color: var(--fresh-text-dark) !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    margin-bottom: 0.5rem;
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ===== */
.card {
    border: 2px solid var(--fresh-border);
    border-radius: 16px;
    box-shadow: 0 2px 10px var(--fresh-shadow);
    background: var(--fresh-white);
}

.card-header {
    background: linear-gradient(135deg, var(--fresh-light-green) 0%, var(--fresh-pale-green) 100%);
    border-bottom: 2px solid var(--fresh-border);
    border-radius: 16px 16px 0 0 !important;
    font-weight: 600;
    color: var(--fresh-dark-green);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--fresh-dark-green);
    font-weight: 700;
}

/* Исправление цвета заголовка "Все товары" в мобильной и десктопной версии */
.h1, .h2, .h3, .h4, .h5, .h6,
h1.h1, h1.h2, h2.h1, h2.h2,
h1, h2,
.products-page h1,
.products-page .h1,
.products-page .h2,
div[class*="col-"] h1,
div[class*="col-"] h2,
div[class*="col-"] .h1,
div[class*="col-"] .h2 {
    color: var(--fresh-dark-green) !important;
}

/* Убираем синий цвет Bootstrap для всех элементов */
.text-primary,
a.text-primary {
    color: var(--fresh-medium-green) !important;
}

/* Исправление цвета заголовков на странице товаров */
div[class*="col-"] h1,
div[class*="col-"] h2,
div[class*="col-"] .h1,
div[class*="col-"] .h2 {
    color: var(--fresh-dark-green) !important;
}

.text-muted {
    color: var(--fresh-text-medium) !important;
}

/* ===== ФУТЕР ===== */
footer.bg-dark {
    background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%) !important;
    color: var(--fresh-white) !important;
    border-top: 3px solid var(--fresh-light-green);
}

footer.bg-dark h5,
footer.bg-dark h6 {
    color: var(--fresh-white) !important;
    font-weight: 700;
    margin-bottom: 1rem;
}

footer.bg-dark a {
    color: var(--fresh-pale-green) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer.bg-dark a:hover {
    color: var(--fresh-white) !important;
    text-decoration: underline;
}

footer.bg-dark .text-white {
    color: var(--fresh-white) !important;
}

footer.bg-dark .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Мобильная версия футера - центрирование */
@media (max-width: 767.98px) {
    footer.bg-dark .container .row {
        text-align: center;
    }
    
    footer.bg-dark .row > div {
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    footer.bg-dark h5,
    footer.bg-dark h6 {
        text-align: center !important;
        width: 100%;
    }
    
    footer.bg-dark p {
        text-align: center !important;
        width: 100%;
    }
    
    footer.bg-dark ul.list-unstyled {
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding-left: 0;
        list-style: none;
    }
    
    footer.bg-dark ul.list-unstyled li {
        text-align: center !important;
        margin-bottom: 0.5rem;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    footer.bg-dark ul.list-unstyled li i {
        margin-right: 0.5rem;
    }
    
    footer.bg-dark ul.list-unstyled li a {
        display: inline-block;
        text-align: center;
    }
    
    /* Центрирование текста копирайта */
    footer.bg-dark .text-center {
        text-align: center !important;
    }
    
    footer.bg-dark .text-center p {
        text-align: center !important;
        width: 100%;
    }
}

/* ===== МОБИЛЬНАЯ НИЖНЯЯ НАВИГАЦИЯ ===== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%);
    border-top: 3px solid var(--fresh-light-green);
    box-shadow: 0 -4px 20px var(--fresh-shadow-hover);
    z-index: 1000;
    padding: 0;
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    max-width: 100%;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--fresh-pale-green);
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 12px;
    min-width: 60px;
    position: relative;
    flex: 1;
}

.mobile-nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.mobile-nav-item span {
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mobile-nav-item:hover {
    color: var(--fresh-white);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.mobile-nav-item:hover i {
    transform: scale(1.1);
}

.mobile-nav-item.active {
    color: var(--fresh-white);
    background: rgba(255, 255, 255, 0.15);
}

.mobile-nav-item.active i {
    color: var(--fresh-white);
    transform: scale(1.15);
}

/* Кнопка поиска - крупная по центру */
.mobile-nav-search {
    background: linear-gradient(135deg, var(--fresh-white) 0%, var(--fresh-pale-green) 100%);
    color: var(--fresh-dark-green) !important;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    min-width: 60px;
    padding: 0;
    margin: -10px 0;
    box-shadow: 0 4px 15px var(--fresh-shadow-hover);
    border: 3px solid var(--fresh-light-green);
    z-index: 1001;
}

.mobile-nav-search i {
    font-size: 1.8rem;
    margin-bottom: 0;
}

.mobile-nav-search span {
    display: none;
}

.mobile-nav-search:hover {
    background: linear-gradient(135deg, var(--fresh-pale-green) 0%, var(--fresh-white) 100%);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 20px var(--fresh-shadow-hover);
}

.mobile-nav-search.active {
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%);
    color: var(--fresh-white) !important;
    border-color: var(--fresh-light-green);
}

/* Бейдж для корзины */
.mobile-nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #dc3545;
    color: var(--fresh-white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    border: 2px solid var(--fresh-dark-green);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Отступ для контента, чтобы не перекрывался мобильной навигацией */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 80px;
    }
    
    footer.bg-dark {
        margin-bottom: 70px;
    }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .desktop-cart-table {
        display: none;
    }
    
    .mobile-cart-item {
        display: block;
    }
    
    .hero-section {
        padding: 35px 0;
        border-radius: 0 0 20px 20px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .product-img,
    .product-img-wrapper {
        height: 200px;
    }
    
    .product-card {
        border-radius: 16px;
    }
    
    /* На планшетах отображение обычное (не по 2 в ряд) */
    .products-grid {
        margin-left: 0;
        margin-right: 0;
    }
    
    .products-grid > .col,
    .products-grid > [class^="col-"],
    .products-grid > [class*=" col-"] {
        flex: auto;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
    
    .products-grid .product-card {
        margin-bottom: 25px;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* Сетка товаров: по два в линию на мобильных */
    .products-grid {
        margin-left: -4px;
        margin-right: -4px;
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .products-grid > .col,
    .products-grid > [class^="col-"],
    .products-grid > [class*=" col-"] {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 4px;
        padding-right: 4px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .products-grid .product-card-link {
        margin: 0;
        display: flex;
        flex-direction: column;
        height: 100%;
        flex: 1;
    }

    .products-grid .product-card {
        margin-bottom: 8px;
        border-radius: 16px;
        border-width: 2px;
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    /* УНИВЕРСАЛЬНОЕ ПРАВИЛО: Устанавливаем размер шрифта названия товара такой же, как в карусели (1em) */
    /* Применяется ко всем карточкам товаров, кроме карусели */
    .product-card h1,
    .product-card h2,
    .product-card h3,
    .product-card h4,
    .product-card h5,
    .product-card h6,
    .product-card .h1,
    .product-card .h2,
    .product-card .h3,
    .product-card .h4,
    .product-card .h5,
    .product-card .h6,
    .product-card .product-title,
    .product-card-link .product-card h1,
    .product-card-link .product-card h2,
    .product-card-link .product-card h3,
    .product-card-link .product-card h4,
    .product-card-link .product-card h5,
    .product-card-link .product-card h6,
    .product-card-link .product-card .h1,
    .product-card-link .product-card .h2,
    .product-card-link .product-card .h3,
    .product-card-link .product-card .h4,
    .product-card-link .product-card .h5,
    .product-card-link .product-card .h6,
    .product-card-link .product-card .product-title,
    .products-grid .product-card h1,
    .products-grid .product-card h2,
    .products-grid .product-card h3,
    .products-grid .product-card h4,
    .products-grid .product-card h5,
    .products-grid .product-card h6,
    .products-grid .product-card .h1,
    .products-grid .product-card .h2,
    .products-grid .product-card .h3,
    .products-grid .product-card .h4,
    .products-grid .product-card .h5,
    .products-grid .product-card .h6,
    .products-grid .product-card .product-title,
    .product-info .product-title,
    .product-info h3.product-title {
        font-size: 1em !important;
        line-height: 1.5;
    }
    
    /* Исключаем карусель - она остается с нормальным размером (1em) */
    .carousel-item .product-card h1,
    .carousel-item .product-card h2,
    .carousel-item .product-card h3,
    .carousel-item .product-card h4,
    .carousel-item .product-card h5,
    .carousel-item .product-card h6,
    .carousel-item .product-card .h1,
    .carousel-item .product-card .h2,
    .carousel-item .product-card .h3,
    .carousel-item .product-card .h4,
    .carousel-item .product-card .h5,
    .carousel-item .product-card .h6,
    .mobile-carousel-wrapper .product-card h1,
    .mobile-carousel-wrapper .product-card h2,
    .mobile-carousel-wrapper .product-card h3,
    .mobile-carousel-wrapper .product-card h4,
    .mobile-carousel-wrapper .product-card h5,
    .mobile-carousel-wrapper .product-card h6,
    .mobile-carousel-wrapper .product-card .h1,
    .mobile-carousel-wrapper .product-card .h2,
    .mobile-carousel-wrapper .product-card .h3,
    .mobile-carousel-wrapper .product-card .h4,
    .mobile-carousel-wrapper .product-card .h5,
    .mobile-carousel-wrapper .product-card .h6,
    .mobile-carousel-product .product-card h1,
    .mobile-carousel-product .product-card h2,
    .mobile-carousel-product .product-card h3,
    .mobile-carousel-product .product-card h4,
    .mobile-carousel-product .product-card h5,
    .mobile-carousel-product .product-card h6,
    .mobile-carousel-product .product-card .h1,
    .mobile-carousel-product .product-card .h2,
    .mobile-carousel-product .product-card .h3,
    .mobile-carousel-product .product-card .h4,
    .mobile-carousel-product .product-card .h5,
    .mobile-carousel-product .product-card .h6 {
        font-size: 1em !important;
        line-height: 1.5;
    }
    
    .products-grid .product-card {
        flex: 1;
        min-height: 100%;
    }
    
    /* Выравнивание контента внутри карточки */
    .products-grid .product-card .product-image-container {
        flex-shrink: 0;
    }
    
    /* Контент карточки (div с классом p-3) */
    .products-grid .product-card > .p-3,
    .products-grid .product-card > div.p-3 {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    /* Кнопка всегда внизу */
    .products-grid .product-card .d-grid,
    .products-grid .product-card .d-grid.gap-2 {
        margin-top: auto;
    }
    
    /* Для карточек с product-info классом (category.php) */
    .products-grid .product-card .product-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .products-grid .product-card .product-info > .d-grid {
        margin-top: auto;
    }
    
    /* Убираем нижний отступ у последних карточек в ряду */
    .products-grid > .col:nth-last-child(-n+2) .product-card {
        margin-bottom: 0;
    }
    
}

/* ===== ТОВАР ДНЯ И КАРУСЕЛЬ ===== */
.product-of-day-card {
    border: 2px solid var(--fresh-border);
    border-radius: 20px;
    box-shadow: 0 4px 15px var(--fresh-shadow);
    overflow: hidden;
}

.product-of-day-card .card-header {
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%);
    border-bottom: none;
    padding: 1rem;
}

.product-of-day-card .card-header h3 {
    color: var(--fresh-white);
    font-weight: 700;
    font-size: 1.5rem;
}

.product-of-day-card .card-header h3 i {
    color: #FFD700;
}

.product-of-day-card .card-body {
    padding: 1.5rem;
}

.product-of-day-card img {
    border-radius: 15px;
    box-shadow: 0 2px 10px var(--fresh-shadow);
}

/* Кнопка "Купить" в карточке товара дня - стиль как у кнопки "В корзину" (десктоп) */
.product-of-day-card .btn-success,
.product-of-day-card .btn {
    border-radius: 25px !important;
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%) !important;
    border: none !important;
    color: var(--fresh-white) !important;
    box-shadow: 0 4px 15px var(--fresh-shadow) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-weight: 600 !important;
    padding: 0.6rem 1.5rem !important;
    position: relative;
    overflow: hidden;
}

.product-of-day-card .btn-success::before,
.product-of-day-card .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.product-of-day-card .btn-success:hover::before,
.product-of-day-card .btn:hover::before {
    left: 100%;
}

.product-of-day-card .btn-success:hover,
.product-of-day-card .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px var(--fresh-shadow-hover) !important;
    background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%) !important;
}

.product-of-day-card .btn-success:active,
.product-of-day-card .btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px var(--fresh-shadow) !important;
}

/* Мобильная версия: оптимизация карточки "товар дня" */
@media (max-width: 767.98px) {
    .product-of-day-card {
        /* Убираем transform scale, чтобы контент не обрезался */
        margin-bottom: 0;
    }
    
    .product-of-day-card .card-header {
        padding: 0.75rem;
    }
    
    .product-of-day-card .card-header h3 {
        font-size: 1.1rem;
        margin-bottom: 0;
    }
    
    .product-of-day-card .card-body {
        padding: 1rem 0.75rem;
    }
    
    .product-of-day-card .card-body img {
        max-height: 180px !important;
        margin-bottom: 0.75rem;
    }
    
    .product-of-day-card .card-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .product-of-day-card .card-body p {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .product-of-day-card .h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    /* Кнопка "Купить" в карточке товара дня - стиль как у кнопки "В корзину" */
    .product-of-day-card .btn-success,
    .product-of-day-card .btn {
        border-radius: 25px !important;
        background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%) !important;
        border: none !important;
        color: var(--fresh-white) !important;
        box-shadow: 0 4px 15px var(--fresh-shadow) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        font-weight: 600 !important;
        padding: 0.6rem 1.5rem !important;
        font-size: 0.95rem !important;
        margin-top: 0.5rem;
        position: relative;
        overflow: hidden;
    }
    
    .product-of-day-card .btn-success::before,
    .product-of-day-card .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }
    
    .product-of-day-card .btn-success:hover::before,
    .product-of-day-card .btn:hover::before {
        left: 100%;
    }
    
    .product-of-day-card .btn-success:hover,
    .product-of-day-card .btn:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px var(--fresh-shadow-hover) !important;
        background: linear-gradient(135deg, var(--fresh-dark-green) 0%, var(--fresh-medium-green) 100%) !important;
    }
    
    .product-of-day-card .btn-success:active,
    .product-of-day-card .btn:active {
        transform: translateY(0) !important;
        box-shadow: 0 2px 10px var(--fresh-shadow) !important;
    }
    
    /* Уменьшаем вертикальный отступ между товаром дня и популярными товарами */
    .row.g-4 > .col-lg-4 {
        margin-bottom: 0.5rem;
    }
    
    .row.g-4 > .col-lg-8 {
        margin-top: 0;
    }
    
    .row.g-4 > .col-lg-8 h2 {
        margin-top: 0;
        margin-bottom: 1rem;
        font-size: 1.25rem;
    }
}

/* Уменьшаем разрыв между товаром дня и популярными товарами - только мобильная версия */
@media (max-width: 991.98px) {
    .row.g-4 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
}

#popularProductsCarousel {
    padding: 0;
}

#popularProductsCarousel .carousel-item {
    padding: 0 15px;
}

#popularProductsCarousel .carousel-control-prev,
#popularProductsCarousel .carousel-control-next {
    width: 5%;
    opacity: 0.8;
}

#popularProductsCarousel .carousel-control-prev-icon,
#popularProductsCarousel .carousel-control-next-icon {
    background-color: var(--fresh-medium-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

#popularProductsCarousel .carousel-indicators {
    margin-bottom: -2rem;
}

#popularProductsCarousel .carousel-indicators button {
    background-color: var(--fresh-medium-green);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
}

/* Мобильная версия карусели - горизонтальная прокрутка в одну линию */
@media (max-width: 767.98px) {
    /* Горизонтальная прокрутка для мобильной карусели */
    .mobile-carousel-scroll {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--fresh-medium-green) var(--fresh-bg-light);
        gap: 15px;
        padding: 10px 0 20px 0;
    }
    
    .mobile-carousel-scroll::-webkit-scrollbar {
        height: 6px;
    }
    
    .mobile-carousel-scroll::-webkit-scrollbar-track {
        background: var(--fresh-bg-light);
        border-radius: 10px;
    }
    
    .mobile-carousel-scroll::-webkit-scrollbar-thumb {
        background: var(--fresh-medium-green);
        border-radius: 10px;
    }
    
    .mobile-carousel-scroll::-webkit-scrollbar-thumb:hover {
        background: var(--fresh-dark-green);
    }
    
    /* Карточка товара в мобильной карусели */
    .mobile-carousel-product {
        flex: 0 0 180px;
        scroll-snap-align: start;
        min-width: 180px;
    }
    
    .mobile-product-card {
        height: 100%;
        border-radius: 12px;
        box-shadow: 0 2px 8px var(--fresh-shadow);
        border: 1px solid var(--fresh-border);
        overflow: hidden;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .mobile-product-card:active {
        transform: scale(0.98);
    }
    
    /* Мини-изображение товара */
    .mobile-product-img-wrapper {
        position: relative;
        overflow: hidden;
        height: 120px !important;
        background: var(--fresh-white);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-product-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 8px;
    }
    
    /* Бейдж для мобильной версии */
    .mobile-badge {
        font-size: 0.65rem;
        padding: 3px 6px;
        top: 5px;
        right: 5px;
    }
    
    /* Информация о товаре */
    .mobile-product-info {
        padding: 10px;
    }
    
    .mobile-product-name {
        font-size: 0.85rem;
        line-height: 1.3;
        margin-bottom: 5px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 2.6em;
    }
    
    .mobile-product-price {
        font-size: 1rem;
        margin-bottom: 8px !important;
    }
    
    .mobile-cart-btn,
    .products-grid .product-card .btn-success.btn-add-to-cart,
    .products-grid .product-card .btn-success[class*="cart"],
    .product-card .btn-success.btn-add-to-cart,
    .product-card .btn-success[class*="cart"],
    .products-grid .btn-success.btn-add-to-cart,
    .products-grid .btn-success[class*="cart"] {
        font-size: 0.75rem !important;
        padding: 6px 8px !important;
    }
    
}

/* ===== СТРАНИЦА УСПЕШНОГО ЗАКАЗА ===== */
.success-card {
    border-radius: 20px;
    box-shadow: 0 8px 30px var(--fresh-shadow-hover);
    border: 2px solid var(--fresh-border);
    background: var(--fresh-white);
    overflow: hidden;
}

.success-icon-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px var(--fresh-shadow-hover);
    animation: scaleIn 0.5s ease-out;
}

.success-icon-wrapper i {
    font-size: 4rem;
    color: var(--fresh-white);
    animation: checkmark 0.6s ease-out 0.3s both;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2) rotate(-45deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.success-card .card-title {
    color: var(--fresh-dark-green);
    font-weight: 700;
    font-size: 2rem;
}

.success-card .card-text {
    color: var(--fresh-text-medium);
    line-height: 1.8;
}

.success-card .alert-info {
    background: linear-gradient(135deg, var(--fresh-light-green) 0%, var(--fresh-pale-green) 100%);
    border: 2px solid var(--fresh-medium-green);
    border-radius: 15px;
    color: var(--fresh-dark-green);
    font-weight: 500;
}

.success-card .btn-primary {
    background: linear-gradient(135deg, var(--fresh-medium-green) 0%, var(--fresh-dark-green) 100%);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.success-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--fresh-shadow-hover);
}

.success-card .btn-outline-primary {
    border: 2px solid var(--fresh-medium-green);
    color: var(--fresh-medium-green);
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.success-card .btn-outline-primary:hover {
    background-color: var(--fresh-medium-green);
    border-color: var(--fresh-medium-green);
    color: var(--fresh-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--fresh-shadow-hover);
}

/* ===== STICKY SEARCH ===== */
#search-section-placeholder {
    display: none;
}

#search-section.is-sticky {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 1019;
    background: var(--fresh-bg-light);
    box-shadow: 0 4px 20px var(--fresh-shadow-hover);
    padding: 10px 0;
    margin-bottom: 0 !important;
}

#search-section.is-sticky > .row.justify-content-center {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

#search-section.is-sticky .search-results {
    z-index: 1050;
}

#search-section.is-sticky .search-input {
    min-height: 44px;
}

@media (max-width: 768px) {
    #search-section.is-sticky {
        padding: 8px 0;
    }

    #search-section.is-sticky > .row.justify-content-center {
        max-width: 100%;
        padding: 0 12px;
    }

    #search-section.is-sticky .col-md-10,
    #search-section.is-sticky .col-lg-8 {
        max-width: 100%;
        flex: 0 0 100%;
    }

    #search-section.is-sticky .search-input {
        min-height: 44px;
        font-size: 16px;
    }
}
