/* ===================================================================
   ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ И БАЗОВЫЕ СТИЛИ
=================================================================== */
:root {
    --main-green: #28a745;
    --main-green-hover: #218838;
    --header-top-bg: #f8f9fa;
    --text-muted-light: #8c8c8c;
    --text-dark: #212529;
    --border-color: #e9e9e9;
    --footer-bg: #f8f9fa;
    --footer-text: #6c757d;
    --footer-title: var(--text-dark);
    --discount-color: #dc3545;
}

body {
    background-color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

.section-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2rem !important;
}

/* --- ЭЛЕМЕНТЫ ФОРМ --- */
.form-check-input:checked {
    background-color: var(--main-green);
    border-color: var(--main-green);
}
.form-check-input:focus {
    border-color: #a1d4b0;
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}
.form-select:focus, .form-control:focus {
    border-color: #a1d4b0;
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}
.btn-primary {
    background-color: var(--main-green);
    border-color: var(--main-green);
}
.btn-primary:hover {
    background-color: var(--main-green-hover);
    border-color: var(--main-green-hover);
}
.btn-success {
    background-color: var(--main-green);
    border-color: var(--main-green);
}
.btn-success:hover {
    background-color: var(--main-green-hover);
    border-color: var(--main-green-hover);
}

/* ===================================================================
   ШАПКА САЙТА (HEADER)
=================================================================== */
.site-header {
    position: relative;
    z-index: 1030;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-top-bar {
    background-color: var(--header-top-bg);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.top-bar-link {
    color: var(--text-muted-light);
    text-decoration: none;
    transition: color 0.2s;
}

.top-bar-link:hover {
    color: #000;
}

.header-main {
    background-color: #fff;
}

.logo-text {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-dark);
    text-decoration: none;
}

.logo:hover .logo-text {
    color: var(--main-green);
}

.btn-catalog {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

/* Иконки действий в шапке */
.header-actions .header-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #333;
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.2s;
}

.header-actions .header-action-item i {
    font-size: 1.5rem;
    color: var(--text-muted-light);
    transition: color 0.2s;
    margin-bottom: 2px;
}

.header-actions .header-action-item span {
    font-size: 0.8rem;
}

.header-actions .header-action-item:hover i {
    color: var(--main-green);
}

/* Счетчики (Badge) */
.cart-count, .fav-count {
    position: absolute;
    top: -5px;
    right: -10px;
    font-size: 10px;
    line-height: 1;
    padding: 3px 6px;
    display: inline-block;
}

.cart-count:empty, .fav-count:empty {
    display: none;
}

/* ===================================================================
   МЕГА-МЕНЮ (MEGA MENU)
=================================================================== */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    z-index: 1020;
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-color);
    
    /* Скрыто по умолчанию */
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
}

.mega-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mega-menu-column .mega-menu-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1.2rem;
    color: var(--text-dark);
    border-bottom: 2px solid var(--main-green);
    display: inline-block;
    padding-bottom: 5px;
}

.mega-menu-list {
    list-style: none;
    padding-left: 0;
}

.mega-menu-list li {
    margin-bottom: 0.6rem;
}

.mega-menu-link {
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.mega-menu-link:hover {
    color: var(--main-green);
    padding-left: 5px;
}

.mega-menu-promo {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    color: #fff;
    text-decoration: none;
}

.mega-menu-promo img {
    width: 100%;
    height: auto;
    transition: transform 0.5s;
}

.mega-menu-promo:hover img {
    transform: scale(1.05);
}

.mega-menu-promo .promo-title {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.mega-menu-promo .promo-text {
    position: absolute;
    bottom: 20px;
    left: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ===================================================================
   ПОИСК (LIVE SEARCH)
=================================================================== */
.search-form-wrapper {
    position: relative;
}

.search-form-wrapper .form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
}

.search-form-wrapper .btn-search {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--main-green);
    font-size: 1.2rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 450px;
    overflow-y: auto;
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: var(--header-top-bg);
}

.search-result-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 15px;
    border-radius: 4px;
}

.search-result-info .name {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.search-result-info .price {
    font-size: 0.85rem;
    color: var(--main-green);
    font-weight: 600;
}

/* ===================================================================
   СЛАЙДЕР (CAROUSEL)
=================================================================== */
#main-slider .carousel-item {
    /*max-height: 450px;*/
    border-radius: 15px;
    overflow: hidden;
}

#main-slider .carousel-item img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

#main-slider .carousel-caption {
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4rem 5rem;
    text-align: left;
}

/* ===================================================================
   КАРТОЧКА ТОВАРА (PRODUCT CARD)
=================================================================== */
.product-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.product-card-img-container {
    position: relative;
    overflow: hidden;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 20px;
}

.product-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card-img {
    transform: scale(1.08);
}

.badge-discount {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--discount-color);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 5;
}

.product-card-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(15px);
    transition: all 0.3s ease;
    z-index: 5;
}

.product-card:hover .product-card-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    background: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    text-decoration: none;
}

.action-btn:hover {
    background: var(--main-green);
    color: #fff;
    border-color: var(--main-green);
}

.product-card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    margin-bottom: 0.8rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-title:hover {
    color: var(--main-green);
}

.product-card-prices {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.2rem;
}

.price-new {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
}

.price-old {
    font-size: 0.95rem;
    color: var(--text-muted-light);
    text-decoration: line-through;
}

/* ===================================================================
   КАТЕГОРИИ (CATEGORY CARDS)
=================================================================== */
.category-needs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.category-card {
    display: block;
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    text-align: center;
    transition: all 0.3s ease;
    background: #fff;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: var(--main-green);
}

.category-card-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.category-card-title {
    display: block;
    padding: 1.2rem 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ===================================================================
   КАТАЛОГ И ФИЛЬТРЫ
=================================================================== */
.breadcrumb-item a {
    text-decoration: none;
    color: var(--main-green);
}

.catalog-sidebar {
    background-color: var(--header-top-bg);
    padding: 1.8rem;
    border-radius: 15px;
    position: sticky;
    top: 100px;
}

.filter-block {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-block:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.filter-category-list li a {
    text-decoration: none;
    color: var(--text-dark);
    display: block;
    padding: 0.4rem 0;
    transition: color 0.2s;
}

.filter-category-list li a:hover, .filter-category-list li a.active {
    color: var(--main-green);
    font-weight: 600;
}

.pagination .page-item .page-link {
    color: var(--main-green);
    border-radius: 5px;
    margin: 0 3px;
}

.pagination .page-item.active .page-link {
    background-color: var(--main-green);
    border-color: var(--main-green);
    color: #fff;
}

/* ===================================================================
   СТРАНИЦА ТОВАРА (PRODUCT DETAIL)
=================================================================== */
.product-gallery .main-product-image {
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    background: #fff;
}

.product-gallery .main-product-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.thumbnail-item {
    width: 85px;
    height: 85px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 5px;
    cursor: pointer;
    object-fit: contain;
    transition: all 0.2s;
}

.thumbnail-item:hover, .thumbnail-item.active {
    border-color: var(--main-green);
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.2);
}

.product-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.price-box h2 {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--main-green);
}

.price-box del {
    font-size: 1.4rem;
}

.product-description img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

.nav-tabs .nav-link {
    color: var(--text-muted-light);
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
}

.nav-tabs .nav-link.active {
    color: var(--main-green);
    background: none;
    border-bottom-color: var(--main-green);
}

/* ===================================================================
   КОРЗИНА (CART)
=================================================================== */
.cart-quantity-input {
    width: 90px;
    text-align: center;
    font-weight: bold;
}

.cart-item-row img {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* ===================================================================
   ФУТЕР (FOOTER)
=================================================================== */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    border-top: 1px solid var(--border-color);
}

.footer-title {
    color: var(--footer-title);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.footer-link {
    color: var(--footer-text);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    margin-bottom: 0.7rem;
}

.footer-link:hover {
    color: var(--main-green);
    transform: translateX(5px);
}

.social-icons .social-icon {
    font-size: 1.8rem;
    color: var(--footer-text);
    margin-right: 1.2rem;
    transition: color 0.3s;
}

.social-icons .social-icon:hover {
    color: var(--main-green);
}

.payment-icons {
    font-size: 2.2rem;
    color: var(--text-muted-light);
}

/* ===================================================================
   УВЕДОМЛЕНИЯ И МОДАЛКИ
=================================================================== */
.cookie-notice {
    position: fixed;
    bottom: 25px;
    left: 25px;
    right: 25px;
    max-width: 450px;
    background-color: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 20px 25px;
    z-index: 2000;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(5px);
}

.cookie-notice p {
    margin: 0;
    padding-right: 20px;
    font-size: 0.9rem;
}

/* Кастомные стили из админки (для инъекции) */
#custom-style-injection {
    display: none;
}
#btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    z-index: 9999;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    line-height: 50px;
    text-align: center;
}

