/*
Theme Name: Astra Child
Theme URI: https://wpastra.com/
Template: astra
Version: 1.0.0
Description: Astra Child Theme
Text Domain: astra-child
*/

/* Основа аккордеона */
.product-accordion {
    margin: 30px 0;
    width: 100%;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid #000;
}

.accordion-item:last-child {
    border-bottom: none;
}

/* Заголовок аккордеона */
.accordion-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    transition: all 0.3s ease;
}

.accordion-title:hover {
    background: #e0e0e0;
}

/* Иконка аккордеона */
.accordion-icon {
    position: relative;
    width: 16px;
    height: 16px;
}

.accordion-icon::before,
.accordion-icon::after {
    content: '';
    position: absolute;
    background: #2c3338;
    transition: transform 0.3s ease;
}

.accordion-icon::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.accordion-icon::after {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

/* Скрываем чекбокс */
.accordion-toggle {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
}

/* Анимация открытия */
.accordion-toggle:checked ~ .accordion-title {
    background: #ebebeb;
}

.accordion-toggle:checked ~ .accordion-title .accordion-icon::after {
    transform: translateX(-50%) rotate(90deg);
    opacity: 0;
}

.accordion-toggle:checked ~ .accordion-content {
    max-height: 1000px;
    padding: 15px 20px;
}

/* Контент аккордеона */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 0 20px;
    background: #fff;
}

/* Стили для характеристик */
.characteristic-item {
    margin: 0 0 10px 0;
    padding: 0;
    line-height: 1.6;
    color: #50575e;
}

.characteristic-item:last-child {
    margin-bottom: 0;
}

.characteristic-item strong {
    color: #2c3338;
    font-weight: 600;
}

/* Кнопка сравнения */
.product-compare-wrapper {
    margin: 25px 0;
    text-align: center;
}

.compare-button {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.compare-button:hover {
    background: #e0e0e0;
}

.compare-button.added {
    background: #4CAF50;
    border-color: #4CAF50;
}

.compare-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.compare-button.added .compare-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z"/></svg>');
}

/* Иконка сравнения в шапке */
.header-compare-link,
.header-favorite-link {
    display: flex;
    align-items: center;
    position: relative;
    text-decoration: none;
}

.header-compare-link img,
.header-favorite-link img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
}

.header-compare-link:hover img,
.header-favorite-link:hover img {
    transform: scale(1.1);
}

.compare-counter,
.favorite-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #CC0000;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@media (max-width: 768px) {
    .header-actions-right {
        gap: 10px;
        margin-left: 10px;
    }
    
    .header-compare-link .compare-icon,
    .header-favorite-link .favorite-icon {
        width: 20px;
        height: 20px;
    }
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.compare-table th, .compare-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

.characteristic-header {
    background-color: #f5f5f5;
    font-weight: bold;
    width: 25%;
}

.product-header {
    background-color: #f9f9f9;
    position: relative;
}

.product-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.remove-from-comparison {
    background: none;
    border: none;
    color: #ff0000;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.remove-from-comparison:hover {
    text-decoration: underline;
}

.characteristic-name {
    font-weight: bold;
    background-color: #f9f9f9;
}

.characteristic-value {
    background-color: #fff;
}

.header-actions-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

    .favorite-btn {
        display: inline-flex;
        gap: 10px;
        align-items: center;
        padding: 10px 15px;
        border: 1px solid #000;
        border-radius: 0;
        cursor: pointer;
        transition: all 0.3s;
        justify-content: center;
        background: none;
        color: #000;
    }
    .favorite-btn:hover {
        color: red;
    }
    .favorite-btn.active {
        background: #ffebee;
        color: #f44336;
    }
    .favorite-icon {
        margin-right: 5px;
    }
    
    .favorites-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    }
        
    .favorites-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        margin-top: 30px;
    }
    .favorite-product {
        border: 1px solid #eee;
        padding: 15px;
        text-align: center;
    }
    .favorite-product img {
        max-width: 100%;
        height: auto;
    }
    .favorite-product-link {
        text-decoration: none;
        color: inherit;
    }
    .buy-favorite, .remove-favorite {
        margin-top: 10px;
        padding: 8px 15px;
        cursor: pointer;
    }
    .buy-favorite {
        background: #cc0000;
        color: white;
        border: none;
        transition: all 0.3s;
    }
    .remove-favorite {
        background: #000000;
        color: white;
        border: none;
        transition: all 0.3s;
    }
    
    .remove-favorite:hover {
        background-color: #454545;
    }
    
    /* Стили модального окна */
    .modal {
        display: none;
        position: fixed;
        z-index: 9999;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
    }
    .modal-content {
        background-color: #fefefe;
        margin: 10% auto;
        padding: 20px;
        border: 1px solid #888;
        width: 80%;
        max-width: 500px;
    }
    .close-modal {
        color: #aaa;
        float: right;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
    }
    .form-group {
        margin-bottom: 15px;
    }
    .form-group label {
        display: block;
        margin-bottom: 5px;
    }
    .form-group input {
        width: 100%;
        padding: 8px;
        box-sizing: border-box;
    }


/* Blog styles */
.blog-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.blog-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.blog-post {
    border: 1px solid #eee;
    padding: 20px;
    transition: all 0.3s ease;
}

.blog-post:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.blog-post-thumbnail {
    margin-bottom: 15px;
}

.blog-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-post h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
}

.blog-post time {
    color: #666;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 15px;
}

.blog-excerpt {
    color: #444;
}

.wp-block-cover {
	transition: all 0,3s ease-in-out;
}

,hero__item::hover .wp-block-cover__background {
	opacity: 0.3;
}

/* Стили для иконок и счетчиков */
.compare-menu-item a,
.favorites-menu-item a {
    display: flex;
    align-items: center;
    position: relative;
}

.compare-menu-item,
.favorites-menu-item  {
    display: flex;
    align-items: center;
    position: relative;
}

.compare-icon,
.favorite-icon {
    font-size: 20px;
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
}

.compare-counter,
.favorite-counter {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    margin-left: 5px;
    position: relative;
    top: -8px;
    left: -5px;
}

/* Для пустых счетчиков */
.compare-counter:empty,
.favorite-counter:empty {
    display: none;
}

.wp-block-cover__background:hover {
    opacity: 0.5;
}


.main-header-menu .menu-item > a {
    color: #ffffff !important;
}

.main-header-menu .menu-item > a:hover {
    color: #cc0000 !important;
    text-decoration: underline;
}

.main-header-menu .menu-item > a:visited {
    color: #ffffff !important; /* Такой же как обычная ссылка */
}

.main-header-menu .menu-item > a:visited:hover {
    color: #cc0000 !important; /* Такой же как обычная ссылка */
}



.main-navigation .sub-menu {
    background-color: #000000; /* Белый цвет фона */
}

/* Цвет текста в подменю */
.main-navigation .sub-menu a {
    color: #ffffff !important;
}

/* Цвет фона при наведении */
.main-navigation .sub-menu li:hover > a {
    background-color: #f8f8f8;
    color: #cc0000 !important;
}


.compare-menu-item:hover .compare-icon,
.favorites-menu-item:hover .favorite-icon {
     filter: brightness(0) saturate(100%) invert(9%) sepia(100%) saturate(7116%) hue-rotate(13deg) brightness(84%) contrast(115%);
}

.author-name {
    display: none;
}

/* Стили для блока кнопок */
.product-action-buttons {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 50px 50px;
    gap: 10px;
    flex-wrap: wrap;
}

.compare-btn {
    border-radius: 0;
    display: inline-flex;
    gap: 10px;
    color: #000;
    background-color: transparent;
    transition: all 0.3s ease-in-out;
    border: 1px solid #000;
    align-items: center;
    justify-content: center;
}

.compare-btn:hover {
    color: red;
    background-color: #000;
}


.product-action-buttons .favorite-btn.active,
.product-action-buttons .compare-btn.added {
    background: transparent;
    color: #ff0000 ;
}

.product-action-buttons {
    color: white;
}

.buy-product-btn {
    background-color: #0E7900;
    border: 1px solid #0E7900;
    grid-column: 1 / 3;
    height: 50px;
    border-radius: 0;
    transition: all 0.3s ease;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.buy-text {
    color: #fff;
    margin-bottom: 0;
}

.buy-icon {
    color: #fff;
}

/* Модальное окно */
#product-order-modal .modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    display: flex;
    gap: 20px;
}

#product-order-modal .modal-product-image {
    flex: 1;
}

#product-order-modal .modal-product-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
}

#product-order-modal .modal-form-container {
    flex: 1;
}

#product-order-modal .close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#product-order-modal .close-modal:hover {
    color: #000;
}

@media (max-width: 750px) {
    .hero__banner {
        grid-template-columns: 1fr !important;
    }
    
    /* Для кнопок на странице товара */
    .product-action-buttons {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    
    .product-action-buttons button {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .buy-product-btn {
        grid-column: 1 / 3;
    }
    
    /* Для иконок в шапке */
    .compare-menu-item a,
    .favorites-menu-item a {
        padding: 5px;
    }
    
    .compare-icon,
    .favorite-icon {
        width: 18px;
        height: 18px;
    }
    
}

/* Стили для модального окна заказа из избранного */
#favorite-order-modal .modal-content {
    display: flex;
    flex-direction: row;
    border-radius: 8px;
    overflow: hidden;
}

#favorite-order-modal .modal-product-image {
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-right: 1px solid #eee;
}

#favorite-order-modal .modal-product-image img {
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
}

#favorite-order-modal .modal-form-container {
    padding: 25px;
    position: relative;
}

#favorite-order-modal h2 {
    color: #333;
    font-size: 1.4em;
    margin-bottom: 20px;
    padding-right: 30px;
}

#favorite-order-modal .close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s;
}

#favorite-order-modal .close-modal:hover {
    color: #777;
}


/* Очистка потока */
.woocommerce-tabs:after {
    content: "";
    display: table;
    clear: both;
}

/* Добавьте в style.css */
.woocommerce-product-details__short-description {
    float: left;
    width: 65%;
}

/* Очистка потока после плавающих элементов */
.woocommerce-Tabs-panel--description:after {
    content: "";
    display: table;
    clear: both;
}

.wc-tabs {
    display: none;
}

/* Стили для блока тех. характеристик в табах */

.tech-specs-download-block {
    border: 1px solid #e0e0e0;
    padding: 20px;
    background-size: cover;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-image: url('https://offroadzone.ru/wp-content/uploads/2025/07/5026621-scaled.jpg');;
}

.tech-specs-download-block .product-title {
    font-size: 1.2em;
    margin: 0 0 10px 0;
    color: #fff;
}

.tech-specs-download-block .tech-specs-title {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #fff;
}

.tech-specs-download-block .file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tech-specs-download-block .file-size {
    color: #fff;
    font-size: 0.9em;
}

.tech-specs-download-block .download-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #cc0000;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.tech-specs-download-block .download-button:hover {
    background-color: #a80000;
}

.tech-specs-tab-wrapper {
    display: flex;
    flex-direction: column;
}

.product-question-block {
    margin: 30px 0;
    padding: 20px;
    background-color: #b8b8b8;
    text-align: center;
}

.hero-descr {
    grid-template-columns: repeat( auto-fill, minmax(320px, 1fr));
}

body .is-layout-flex {
    justify-content: center;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .tech-specs-tab-wrapper {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 30px !important;
    }
    
    
    #favorite-order-modal .modal-content {
        flex-direction: column;
    }
    
    #favorite-order-modal .modal-product-image {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .tech-specs-download-block,
    .woocommerce-Tabs-panel--description {
        float: none;
        width: 100%;
        margin-left: 0;
    }
    
    .tech-specs-download-block {
        margin-top: 30px;
    }
}