/* ==================================================
   1. СБРОС И БАЗОВЫЕ НАСТРОЙКИ
   ================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
     color: #212121; /* черный */
    /*color: #12770c; --зеленый--*/
    background-color: #ffffff;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================================================
   2. ШАПКА (HEADER)
   ================================================== */
.header {
    background-color: #292929;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.logo img {
    max-height: 45px;
    width: auto;
    display: block;
}
.nav-menu {
    display: flex;
    gap: 32px;
    list-style: none;
}
.nav-menu a {
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}
.nav-menu a:hover {
    color: #ccc;
}
.menu-toggle {
    display: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    background: none;
    border: none;
}

/* Иконка корзины */
.nav-cart a {
    position: relative;
    color: #fff;
    text-decoration: none;
}
#cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #c00;
    color: #fff;
    border-radius: 0%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================================================
   3. HERO (ПЕРВЫЙ ЭКРАН)
   ================================================== */
.hero {
    background: linear-gradient(rgba(0,0,0,0.68), rgba(0,0,0,0.68));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 140px 0 20px;
    text-align: center;
    color: #f4f3ff;  /*---цвет шрифта на картинке в шапке сайта-------*/

}
.hero h1 {
    font-size: 44px;
    font-weight: 300;
    margin-bottom: 24px;
}
.hero p {
    font-size: 20px;
    margin-bottom: 32px;
    font-weight: 200;
}

.btn-primary {                      /*-----стиль кнопок-----*/
    display: inline-block;
    background-color: #212121;
    color: #fff;
    padding: 10px 70px;
    font-size: 18px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 0;
}

/* Только для сетки: кнопка на всю ширину */
.product-grid:not(.list-view) .product-card .btn-primary,
.product-grid:not(.list-view) .product-card .btn-outline {
    width: 100%;
    padding: 10px 20px;
    box-sizing: border-box;
    text-align: center;
}

/* Список: кнопка не растягивается, остаётся auto */
.product-grid.list-view .product-card .btn-primary,
.product-grid.list-view .product-card .btn-outline {
    width: auto !important;
    padding: 8px 24px;
}



.btn-primary:hover {
    background-color: #3a3a3a;
}



/* Компактный Hero (десктоп) */
#hero.hero {
    padding-top: 10px !important;
    padding-bottom: 20px !important;   /* ← уменьшили с 20px до 5px */
    min-height: auto !important;
}
#hero.hero h1 {
    padding: 5px 28px !important;
    font-size: 32px !important;
    margin-bottom: 12px !important;
}
#hero.hero p {
    font-size: 18px !important;
    margin-bottom: 18px !important;
}
#hero.hero .btn-primary {
    padding: 5px 28px !important;
    font-size: 16px !important;
}

/* ==================================================
   4. ОБЩИЕ СЕКЦИИ
   ================================================== */
.section {
    padding: 30px 0;  /*----отступ от hero------------*/
}
.section-title {
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 10px;
}
.section-overline {
    color: #A9A9A9;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-size: 17px;
}


/* ==================================================
   5. КАТАЛОГ (СЕТКА, СПИСОК, КАРТОЧКИ)
   ================================================== */
.catalog-layout {
    display: flex;
    gap: 40px;
}
.catalog-sidebar {
    flex: 0 0 250px;
}
.sidebar-menu {
    background: #ffffff;
    border: none;
}
.sidebar-menu .sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #030303;
}
.sidebar-menu ul {
    list-style: none;
    padding: 0;
}
.sidebar-menu li {
    margin-bottom: 5px;   /*-----------отступ между категориями-----------------------------------*/
}
.sidebar-menu a {
    text-decoration: none;
    font-size: 18px;
    color: #030303;
    transition: 0.2s;
}
.sidebar-menu a:hover {
    color: #777;
}
.catalog-content {
    flex: 1;
}
.catalog-header {
    margin-bottom: 30px;
}
.catalog-header .main-title {
    font-size: 32px;
    font-weight: 400;
}

/* Переключатель вида каталога */
.catalog-view-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-end;
}
.view-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 0;
    transition: 0.2s;
    color: #212121;
}
.view-btn.active {
    background: #212121;
    color: #fff;
    border-color: #212121;
}
.view-btn:hover {
    background: #ddd;
}
.view-btn.active:hover {
    background: #212121;
}

/* Сетка товаров */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

/* Карточка товара – единый стиль для сетки */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #ddd;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    background: #fff;
}
.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #f5f5f5;
    display: block;
}
.product-card .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 10px;
}
.product-card h3 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 8px 0;
}
.product-card h3 a {
    color: inherit;
    text-decoration: none;
}
.product-card h3 a:hover {
    text-decoration: underline;
}
.product-card .desc {
    color: #5f5f5f;
    font-size: 14px;
    margin-bottom: 10px;
    flex: 1;
}
.product-card .price {
    font-weight: 600;
    font-size: 18px;
    text-align: center;
    margin-bottom: 10px;
}
.product-card .product-bottom {
    margin-top: auto;
    padding-top: 5px;
}
.btn-outline {
    background: #212121;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    text-align: center;
    display: inline-block;
    border-radius: 0;
}
.btn-outline:hover {
    background: #3e3e3e;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #aaa;
}

/* Режим списка */
.product-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.product-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 15px;
    gap: 20px;
}
.product-grid.list-view .product-card img {
    width: 160px;
    height: 120px;
    object-fit: cover;
    flex-shrink: 0;
}
.product-grid.list-view .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-grid.list-view .product-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
}
.product-grid.list-view .product-info .desc {
    margin-bottom: 8px;
}
.product-grid.list-view .product-bottom {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
}
.product-grid.list-view .product-bottom .price {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
    margin: 0 20px 0 auto;
}
.product-grid.list-view .product-bottom .btn-outline {
    width: auto;
    padding: 8px 24px;
    margin: 0;
    font-size: 15px;
}

/* Мобильная адаптация кнопок в сетке */
@media (max-width: 480px) {
    .product-card .product-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .product-card .btn-outline {
        width: 100%;
    }
}


/* ==================================================
   6. ПРЕИМУЩЕСТВА, РЕКОМЕНДАЦИИ, ПРОМО, ОТЗЫВЫ, КОНТАКТЫ
   ================================================== */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 40px;
}
.advantage-item {
    text-align: center;
    padding: 20px;
}
.advantage-icon {
    font-size: 48px;
    color: #424242;
    margin-bottom: 20px;
}
.advantage-item h3 {
    font-size: 20px;
    margin-bottom: 12px;
}
.advantage-item p {
    color: #5f5f5f;
}

.double-block {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}
.double-block .image-side {
    flex: 1;
}
.double-block .image-side img {
    width: 100%;
    display: block;
}
.double-block .content-side {
    flex: 1;
}
.btn-secondary {
    background: #212121;
    color: #fff;
    display: inline-block;
    padding: 12px 32px;
    margin-top: 20px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    border-radius: 0;
}

.promo-section {
    background: linear-gradient(rgba(0,0,0,0.64), rgba(0,0,0,0.64)),
                url('../img/promo-bg.jpg') center/cover;
    color: #fff;
    text-align: center;
    padding: 80px 0;
}
.promo-form {
    max-width: 500px;
    margin: 0 auto;
    background: rgba(0,0,0,0.5);
    padding: 30px;
}
.promo-form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    border: none;
}
.promo-form button {
    width: 100%;
}

/* ==================================================
   7. ОТЗЫВЫ (ОБЩАЯ СЕКЦИЯ И КАРТОЧКА ТОВАРА)
   ================================================== */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.review-card {
    background: #f9f9f9;
    padding: 24px;
    text-align: left;
    border: 1px solid #eee;
}
.review-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
}
.review-card h4 {
    margin-bottom: 8px;
}
.review-card p {
    font-size: 14px;
    color: #444;
}
.review-card .review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.review-card .review-author {
    font-weight: 600;
    color: #212121;
}
.review-card .review-stars {
    color: #ffb800;
    font-size: 14px;
}
.review-card .review-text {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}
.review-card .review-date {
    color: #999;
    font-size: 12px;
}

/* Форма отзыва (общая и в карточке товара) */
.review-form {
    max-width: 600px;
    margin: 40px auto 0;
    background: #f9f9f9;
    padding: 30px;
    box-sizing: border-box;
}
.review-form h3 {
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 500;
}
.star-rating {
    display: flex;
    gap: 8px;
    font-size: 32px;
    cursor: pointer;
    margin-bottom: 15px;
}
.star-rating .star {
    color: #ccc;
    transition: color 0.2s;
}
.star-rating .star.active,
.star-rating .star:hover {
    color: #ffb800;
}
.form-message {
    margin-top: 15px;
    font-size: 14px;
    color: #2e7d32;
}

/* Обёртка отзывов в карточке товара */
.product-reviews-wrapper {
    max-width: 800px;
    margin: 40px auto 0;
}
.review-form-container {
    background: #f9f9f9;
    padding: 30px;
    margin-bottom: 40px;
    box-sizing: border-box;
}
.review-form-container h3 {
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 500;
}
.review-form-container select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    font-family: inherit;
    background: #fff;
}
.reviews-section {
    max-width: 800px;
    margin: 0 auto;
}
.section-subtitle {
    color: #777;
    margin-bottom: 30px;
    font-size: 16px;
}

/* ==================================================
   8. КОНТАКТЫ
   ================================================== */
.contact-grid {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}
.contact-info {
    flex: 1;
}
.contact-form {
    flex: 1;
}
.form-group {
    margin-bottom: 20px;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    font-family: inherit;
}

/* ==================================================
   9. FOOTER
   ================================================== */
.footer {
    background: #292929;
    color: #ccc;
    padding: 25px 0 15px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: 1000px;
    margin: 0 auto;
    gap: 80px;
    justify-content: space-between;
}
.footer-col h2 {
    color: #fff;
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 600;
}
.footer-col ul {
    list-style: none;
    margin-top: 0;
    padding: 0;
}
.footer-col li {
    margin-bottom: 8px;
    line-height: 1.5;
}
.footer-col a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-col a:hover {
    color: #fff;
}
.footer-brand .footer-logo {
    font-size: 24px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 10px;
}
.footer-contacts {
    max-width: 250px;
    overflow: hidden;
}
.footer-contacts a {
    color: #ccc;
    text-decoration: none;
}
.footer-contacts a:hover {
    color: #fff;
}
.footer-bottom {
    width: 100% !important;
    text-align: center !important;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #444;
}
.footer-bottom p {
    color: #4f5d7d;
    font-weight: 400;
    margin: 0;
    padding: 0 0 5px;
}
@media (max-width: 768px) {
    .footer-grid {
        gap: 20px;
    }
}

/* ==================================================
   10. МОДАЛЬНЫЕ ОКНА (ЗАКАЗ, КОРЗИНА)
   ================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: #fff;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    word-wrap: break-word;
}
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
}
.modal h3 {
    margin-bottom: 20px;
}
.modal input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}
.modal button {
    width: 100%;
}

/* ==================================================
   11. КОРЗИНА – ТАБЛИЦА
   ================================================== */
.cart-modal {
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}
.cart-table thead th {
    background: #f0f0f0;
    border-bottom: 2px solid #212121;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #212121;
}
.cart-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    text-align: left;
    font-size: 15px;
}
.cart-table .cart-item-img {
    width: 60px;
}
.cart-table .cart-item-img img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    display: block;
    vertical-align: middle;
}
.cart-table .cart-item-name {
    font-weight: 500;
}
.cart-table .cart-item-price,
.cart-table .cart-item-total {
    white-space: nowrap;
}
.cart-table .cart-item-qty {
    white-space: nowrap;
}
.cart-table .cart-item-total {
    font-weight: 500;
}
.cart-table .cart-item-remove {
    width: 40px;
    text-align: center;
}

/* === КРУГЛЫЕ КНОПКИ (как в мобильной версии) – для всех устройств === */
.cart-table .qty-btn {
    background: #fff !important;
    border: 1px solid #ddd !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 0% !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #212121 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    margin: 0 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.cart-table .qty-btn:hover {
    background: #e4e6ea !important;
    transform: scale(1.02) !important;
}

.cart-table .remove-btn {
    background: #fff !important;
    border: 1px solid #ddd !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    color: #c00 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}
.cart-table .remove-btn:hover {
    background: #fee2e2 !important;
    border-color: #c00 !important;
    transform: scale(1.02) !important;
}

/* Чуть меньше на мобильных (опционально) */
@media (max-width: 768px) {
    .cart-table .qty-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
    }
    .cart-table .remove-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }
}

.cart-total {
    text-align: right;
    font-weight: 700;
    font-size: 18px;
    margin-top: 15px;
    padding-right: 12px;
}



/* ==================================================
   12. КАРТОЧКА ТОВАРА
   ================================================== */
.breadcrumbs {
    margin: 5px 0 10px;
    font-size: 14px;
    color: #777;
}
.breadcrumbs a {
    color: #212121;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumbs a:hover {
    color: #000;
}
#item_card {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    margin-top: 30px;
    margin-bottom: 60px;
}
#left_card {
    flex: 1.4;
    min-width: 280px;
}
#right_card {
    flex: 1;
    min-width: 280px;
}

/* Галерея */
.product-gallery {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    max-width: 100%;
}
.thumbnails-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80px;
    flex-shrink: 0;
    max-height: 370px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.thumbnails-column::-webkit-scrollbar {
    display: none;
}
.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: border-color 0.2s;
}
.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: #595959;
}
.main-image-wrapper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.main-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #000;
    border-radius: 0;
    transition: transform 0.3s ease;
}
.main-image-wrapper img:hover {
    transform: scale(1.5);
    cursor: zoom-in;
}

/* Метки товара */
.item_metainfo {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}
.item_metainfo .item_available i {
    color: #2e7d32;
    margin-right: 5px;
}
#right_card h1 {
    font-size: 30px;
    font-weight: 500;
    margin-bottom: 15px;
}
.item_short_description {
    margin-bottom: 5px;
    color: #555;
    line-height: 1.5;
}
.item_price {
    margin-top: 10px;
    font-size: 18px;
   /*-- font-weight: 700;  --*/
    margin-bottom: 8px;
}
#right_card .btn-primary {
    padding: 10px 50px;
    font-size: 20px;
    border-radius: 0;
}
.item_properties {
    margin-top: 5px;
}
.item_properties h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}
.prop {
    margin-top: 5px;
    display: flex;
    padding: 1px 0;
    border-bottom: 1px solid #eee;
}
/*---
.prop-title {
    width: 100px;
    font-weight: 500;
    color: #666;
}
.prop .val {
    font-weight: 400;
    padding: 1px 50px;
}
---*/

.prop-title {
    width: auto; /* убираем фиксацию */
    min-width: 100px; /* минимальная ширина */
    white-space: nowrap;
}
.prop .val {
    white-space: nowrap;
    padding-right: 20px; /* убираем padding: 1px 50px; заменяем на скромный отступ */
}
/* Если нужен отступ между колонками */
.prop {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
}






/* Вкладки (табы) */
.product-tabs {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 0px solid #dddddd;
}
.tab-buttons {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: none;
}
.tab-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    color: #333;
    transition: all 0.2s ease;
    outline: none;
    margin-bottom: 0;
    border-radius: 0 !important;
}
.tab-btn:first-child {
    border-right: none;
}
.tab-btn:last-child {
    border-left: none;
}
.tab-btn.active {
    background: #212121;
    color: #fff;
    border-color: #212121;
}
.tab-btn:hover:not(.active) {
    background: #e0e0e0;
    color: #000;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Общий стиль для панелей вкладок */
#tab-description,
#tab-characteristics {
    border: 1px solid #ddd;
    padding: 20px 25px;
    margin-top: 0;
}

/* Таблица характеристик */
.char-table {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse;
    border: 1px solid #ddd;
}
.char-table td {
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    line-height: 1.5;
}
.char-table td:first-child {
    font-weight: 600;
    color: #212121;
    white-space: nowrap;
    width: 1%;
    padding-right: 30px;
}


/* Таблица характеристик json*/

.char-table-json {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse;
    border: 0px solid #ddd;

}

.char-table-json td {
    padding: 6px 18px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    line-height: 1.5;
}
.char-table-json td:first-child {
    font-weight: 500;
    color: #212121;
    white-space: nowrap;
    width: 1%;
    padding-right: 30px;
 }   

/* Заголовки разделов в JSON-таблице */
.char-table-json .section-header td {
    padding-top: 40px;   /* вместо <br> */
    padding-bottom: 4px;
    color: #2980b9;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: transparent;
    border-bottom: none;
}





/* Цена и кнопка "В корзину" в одну строку */
.price-cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}
.price-cart-row .item_price {
    margin-bottom: 0;
    white-space: nowrap;
}
.price-cart-row .btn-primary {
    width: auto;
    padding: 12px 24px;
    margin-top: 0;
    border-radius: 0;
}

/* ==================================================
   13. ВИДЕО В КАРТОЧКЕ ТОВАРА
   ================================================== */
.video-thumb-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.video-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}
.video-play-icon {
    position: absolute;
    font-size: 28px;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    pointer-events: none;
}
.video-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    border: 1px solid #ddd;
    width: 80px;
    height: 80px;
    overflow: hidden;
}
.video-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-thumb-icon {
    position: relative;
    z-index: 1;
    font-size: 32px;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* ==================================================
   14. ЛАЙТБОКС
   ================================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 3000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}
.lightbox.active {
    display: flex;
}
#lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border: 2px solid #555;
    border-radius: 0;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}
#lightbox-img.zoomed {
    transform: scale(1.8);
    cursor: zoom-out;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 44px;
    color: #fff;
    cursor: pointer;
    z-index: 3010;
    line-height: 1;
    display: none;
}
.lightbox.active .lightbox-close {
    display: block;
}
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 52px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    z-index: 3020;
    padding: 0 10px;
    transition: opacity 0.2s;
    line-height: 1;
}
.lightbox-arrow:hover {
    opacity: 0.8;
}
.lightbox-prev {
    left: 10px;
}
.lightbox-next {
    right: 10px;
}
.lightbox-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    overflow-x: auto;
    max-width: 95vw;
    padding: 10px 0;
    justify-content: center;
}
.lightbox-thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 0;
    transition: border-color 0.2s;
}
.lightbox-thumbnails img.active,
.lightbox-thumbnails img:hover {
    border-color: #fff;
}

/* Экстренный фикс лайтбокса */
#lightbox.active {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.95) !important;
    z-index: 3000 !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==================================================
   15. СТРАНИЦЫ (page.php)
   ================================================== */
.page-card {
    background: #fff;
    border: 1px solid #eee;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.page-card .section-title {
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 500;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}
.page-content {
    line-height: 1.8;
    font-size: 16px;
    color: #333;
}
.page-content p {
    margin-bottom: 16px;
}
.page-content a {
    color: #212121;
    text-decoration: underline;
}
.page-content a:hover {
    color: #000;
}

/* ==================================================
   16. РЕЙТИНГ ТОВАРОВ
   ================================================== */
.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 5px 0 5px 10px;
}
.product-rating .stars i {
    font-size: 16px;
    color: #ffb800;
    margin-right: 2px;
}
.product-rating .stars i.fa-star-half-alt {
    color: #ffb800;
}
/* Рейтинг в сетке – по центру с небольшим отступом */
.product-grid:not(.list-view) .product-rating {
    justify-content: center;
    margin-right: 10px;
}

/* ==================================================
   17. ПОИСКОВАЯ СТРОКА В КАТАЛОГЕ
   ================================================== */
.sidebar-search input,
.catalog-content .form-control {
    width: 100%;
    box-sizing: border-box;
}
.catalog-content .btn-primary {
    white-space: nowrap;
}

/* ==================================================
   18. ОБЩАЯ АДАПТИВНОСТЬ
   ================================================== */
@media (max-width: 992px) {
    .catalog-layout {
        flex-direction: column;
    }
    .catalog-sidebar {
        flex: auto;
    }
    .sidebar-menu ul {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }
    .sidebar-menu li {
        margin-bottom: 0;
    }
}
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background: #292929;
        padding: 20px 0;
        margin-top: 15px;
        gap: 15px;
        text-align: center;
    }
    .nav-menu.active {
        display: flex;
    }
    .menu-toggle {
        display: block;
    }
    .hero h1 {
        font-size: 32px;
    }
    .section-title {
        font-size: 26px;
    }
    .product-grid {
        gap: 20px;
    }
    .double-block {
        flex-direction: column;
    }
    #lightbox-img {
        max-height: 60vh;
    }
    .lightbox-arrow {
        font-size: 36px;
    }
    .lightbox-thumbnails img {
        width: 50px;
        height: 50px;
    }
    .page-card {
        padding: 20px;
    }
    .footer-grid {
        gap: 20px;
    }
}

/* ==================================================
   19. ПРИЖИМАЕМ ФУТЕР К НИЗУ
   ================================================== */
main {
    flex: 1 0 auto;
}  



/* ==================================================
   20. ИЗБРАННОЕ (финальный, единый стиль)
   ================================================== */
.nav-wishlist a {
    position: relative;
    color: #fff;
    text-decoration: none;
}
#wishlist-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #c00;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Кнопка «В избранное» – базовый стиль */
.wishlist-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 8px;
    
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wishlist-btn i {
    font-size: 18px;
    color: #999;
}
.wishlist-btn:hover i {
    color: #ff4081;
}
.wishlist-btn.added i {
    color: #e74c3c;
}
.wishlist-btn.added {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.05);
}

/* В карточке товара – позиционируем поверх фото */
.product-card .wishlist-btn,
#item_card .wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    margin: 0;
    z-index: 20;
}

/* Родительский контейнер должен быть относительным */
.product-card,
#item_card {
    position: relative;
}


/* Прижимаем кнопки в карточках товара к низу */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}
.product-card .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 10px 10px 10px;
}
.product-card .product-bottom {
    margin-top: auto;
    padding-top: 10px;
}
.product-card .desc {
    flex: 1;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Для режима списка – иная структура, но кнопки тоже прижимаем */
.product-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.product-grid.list-view .product-card .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-grid.list-view .product-bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}   



/* Скрыть переключатель вида на мобильных и принудительно использовать сетку */
@media (max-width: 768px) {
    .catalog-view-switch {
        display: none !important;
    }
    .product-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    }
    /* Отменяем все стили списка */
    .product-grid.list-view {
        display: grid !important;
        flex-direction: unset !important;
    }
    .product-grid.list-view .product-card {
        display: flex !important;
        flex-direction: column !important;
        padding: 5px !important;
    }
    .product-grid.list-view .product-card img {
        width: 100% !important;
        height: 220px !important;
    }
    .product-grid.list-view .product-info {
        display: contents !important;
    }
    .product-grid.list-view .product-bottom {
        margin-top: auto;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .product-grid.list-view .product-bottom .price {
        text-align: center !important;
        margin: 0 0 10px 0 !important;
    }

}



/* Мобильная корзина – карточки (улучшенная версия) */
@media (max-width: 768px) {
    .cart-mobile-list {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    .cart-mobile-item {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px;
        padding-bottom: 50px;
        border: 1px solid #eee;
        border-radius: 12px;
        background: #fff;
        position: relative;
    }
    .cart-mobile-img {
        width: 80px;
        flex-shrink: 0;
    }
    .cart-mobile-img img {
        width: 100%;
        height: 80px;
        object-fit: cover;
        border-radius: 8px;
    }
    .cart-mobile-info {
        flex: 1;
        min-width: 160px;
    }
    .cart-mobile-name {
        font-weight: 500;
        margin-bottom: 4px;
    }
    .cart-mobile-price,
    .cart-mobile-total {
        font-size: 14px;
        color: #555;
    }
    .cart-mobile-qty {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 12px 0;
    }
    /* Широкие прямоугольные кнопки */
    .cart-mobile-qty .qty-btn {
        background: #f0f2f5;
        border: none;
        width: 60px;
        height: 30px;
        border-radius: 1px;
        font-size: 24px;
        font-weight: 600;
        color: #212121;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .cart-mobile-qty span {
        font-size: 18px;
        font-weight: 500;
        min-width: 40px;
        text-align: center;
    }
    .cart-mobile-item .remove-btn {
        position: absolute;
        bottom: 12px;
        right: 12px;
        background: none;
        border: none;
        font-size: 24px;
        color: #c00;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }
}


/* Выравнивание карточек товаров в сетке (чтобы нижняя рамка была ровной) */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 10px; /* добавляем небольшой отступ снизу внутри карточки, чтобы рамка не прилипала к тексту */
}
.product-card .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 10px 10px 10px;
}
.product-card .product-bottom {
    margin-top: auto;
    padding-top: 10px;
}
.product-card .desc {
    flex: 1;
    margin-bottom: 10px;
}
/* Для режима списка уже есть отдельные стили, они не конфликтуют */


/* ==================================================
   Личный кабинет – единый стиль кнопок
   ================================================== */
.account-buttons {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 20px;
}
.account-buttons .btn-primary,
.account-buttons .btn-secondary {
    flex: 0 0 auto;
    min-width: 200px;
    text-align: center;
}
/* Если кнопка смены пароля ссылка, делаем её похожей на кнопку */
.change-password-link {
    display: inline-block;
    background: #212121;
    color: #fff;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}
.change-password-link:hover {
    background: #3a3a3a;
}

/* Фикс CLS: резервируем место под изображения до их загрузки */
.product-card img {
    aspect-ratio: 260 / 220;
    width: 100%;
    height: auto;
    object-fit: cover;
}


#cart-count, #wishlist-count {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    background: #c00;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    line-height: 18px;
    padding: 0 4px;
}


.hero {
    min-height: 300px; /* подберите значение, чтобы при загрузке фона не прыгало */
}

/*-------------*/
/* Прижимаем кнопки в каталоге к правому краю и выравниваем с заголовком */
.catalog-content {
    position: relative;
}
.catalog-header {
    margin-right: 120px; /* освобождаем место для кнопок */

}
.catalog-view-switch {
    position: absolute;
    top: 30px;
    right: 0;
    display: flex;
    gap: 10px;
}
/* На мобильных кнопки можно скрыть или перенести */
@media (max-width: 768px) {
    .catalog-view-switch {
        position: static;
        margin-top: 10px;
        justify-content: flex-end;
    }
    .catalog-header {
        margin-right: 0;
    }


/* Выравнивание сайдбара и контента каталога */
.catalog-sidebar {
    margin-top: 0;
    padding-top: 0;
}
/* Убираем верхний отступ у контента, чтобы сравнять с сайдбаром */
.catalog-content {
    margin-top: 0;
}
/* Если у .catalog-header есть верхний отступ, убираем его */
.catalog-header {
    margin-top: 0;
    padding-top: 0;
}
/* Альтернатива: добавить сайдбару отступ сверху, равный отступу контента */
.catalog-sidebar {
    margin-top: 35px; /* подберите значение, чтобы визуально сравнять */
}


/* Блок "Поделиться" */
.share-block {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    
}


.share-link {
    display: inline-flex;   /* уже должно быть */
    align-items: center;
    justify-content: center;
    width: 50px !important;
    height: 50px !important;
    background: #f0f0f0;
    border-radius: 50%;
    color: #212121;
    font-size: 28px;
    transition: all 0.2s;
    text-decoration: none;
}

/*----просмотры--------------*/
.item_views {
    font-size: 14px;
    color: #777;
    margin-bottom: 10px;
}
.product-views {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}


/* Скрываем виджет LiveTex до согласия */
.livetex-icon, .ltx-widget, .ltx-widget-button {
    display: none !important;
}

/* Улучшаем области касания для мобильных */
.nav-menu a,
.nav-cart a,
.menu-toggle,
.view-btn,
.btn-primary,
.btn-outline,
.sidebar-menu a,
.pagination a,
.footer a {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Увеличиваем отступы между элементами меню */
.nav-menu li {
    margin: 0 8px;
}

.similar-products-section {
    border-top: 1px solid #eee;
    padding-top: 30px;
}
@media (max-width: 768px) {
    .similar-products-section .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    }
}

/*-------под меню---------------------*/
.sidebar-menu ul {
    padding-left: 0;
}
.sidebar-menu li {
    list-style: none;
}
.sidebar-menu a.active {
    font-weight: 600;
    color: #000;
    text-decoration: underline;
}

.sidebar-menu ul ul {
    display: none; /* по умолчанию скрыты */
}
.sidebar-menu li.open > ul {
    display: block; /* показываем только у открытых родителей */
}
.sidebar-menu a.active {
    font-weight: 600;
    color: #000;
}

