/* 
   Файл custom.css для дочерней темы Hello Elementor Child.
   Здесь вы можете добавлять свои стили с высоким приоритетом.
*/ 

body .product-view-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

body .product-view-switcher a {
    padding: 5px 10px;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 3px;
}

body .product-view-switcher a.active {
    background-color: #0073aa;
    color: white;
}

/* Стили для отображения товаров в виде grid */
body .woocommerce ul.products.grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
}

/* Стили для отображения товаров в виде list */
body .woocommerce ul.products.list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

body .woocommerce ul.products.list li.product {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    width: 100% !important;
}

/* Общие стили для иконок */
i {
    font-family: FontAwesome;
    font-style: normal;
}

/* Стили для контейнера select и иконки */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.select-wrapper select.orderby {
    padding-left: 30px;
    padding-right: 30px;
}

/* Стили для иконок в выпадающем списке сортировки */
body .woocommerce-ordering select.orderby {
    padding-right: 30px;
}

body .woocommerce-ordering select.orderby option[value="price"] {
    position: relative;
    padding-left: 20px;
}

body .woocommerce-ordering select.orderby option[value="price"]::before {
    content: "\f161";
    font-family: FontAwesome;
    position: absolute;
    left: 5px;
}

body .woocommerce-ordering select.orderby option[value="price-desc"] {
    position: relative;
    padding-left: 20px;
}

body .woocommerce-ordering select.orderby option[value="price-desc"]::before {
    content: "\f162";
    font-family: FontAwesome;
    position: absolute;
    left: 5px;
}

/* Стили для иконки сортировки */
.sort-icon-wrapper {
    display: inline-block;
    margin-bottom: 20px;
    cursor: pointer;
}

.sort-icon-wrapper i {
    font-size: 20px;
    color: #666;
    transition: color 0.3s ease;
}

.sort-icon-wrapper i:hover {
    color: #0073aa;
}

/* Стили для переключателя вида товаров */
.view-switcher {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.view-switcher a {
    margin-right: 10px;
    color: #666;
    text-decoration: none;
}

.view-switcher a.active {
    color: #000;
}

/* Стили для иконок сортировки */
.sort-icons-wrapper {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.sort-icons-wrapper i {
    font-size: 18px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-left: 10px;
}

.sort-icons-wrapper i:hover {
    color: #000;
}

/* Стили для сетки товаров */
.products.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Стили для списка товаров */
.products.list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.products.list .product {
    display: flex;
    gap: 20px;
}

.products.list .product img {
    width: 200px;
    height: auto;
}

.products.list .product .woocommerce-loop-product__title {
    font-size: 18px;
    margin-bottom: 10px;
}

.products.list .product .price {
    font-size: 16px;
    margin-bottom: 10px;
}

.products.list .product .button {
    margin-top: 10px;
}

/* Стили для блока количества товара */
.quantity-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.quantity-wrap .label {
    font-weight: 500;
    color: #333;
}

.quantity-wrap .quantity-cal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 150px;
    margin: 0 auto;
}

.quantity-wrapper {
    flex: 1;
    margin: 0 10px;
}

.quantity-wrapper .quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-wrapper input.qty {
    width: 50px;
    text-align: center;
    margin: 0;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.quantity-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #e7e7e7;
}

.quantity-btn i {
    font-size: 12px;
    color: #666;
}

.quantity-btn[style*="opacity: 0.5"] {
    cursor: not-allowed;
    background: #f7f7f7;
}

.quantity-btn[style*="opacity: 0.5"]:hover {
    background: #f7f7f7;
}

/* Стили для виджета SKU товара */
.product-sku {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    padding: 5px 0;
}

.product-sku:empty {
    display: none;
}

.purchase-count-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.purchase-count-icon {
    display: inline-flex;
    align-items: center;
}

.product-title {
    display: inline-block;
}

#purchase-count {
    display: inline-block;
    margin: 0;
}

/* Стили для фиксированной корзины */
.sticky-add-to-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 15px;
    display: none;
}

.sticky-add-to-cart-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.sticky-product-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.sticky-product-title {
    font-weight: 500;
    flex: 1;
}

.sticky-product-price {
    font-weight: 600;
    color: #333;
}

.sticky-add-to-cart-button {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.sticky-add-to-cart-button:hover {
    background: #45a049;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sticky-add-to-cart-inner {
        flex-wrap: wrap;
        gap: 10px;
    }

    .sticky-product-title {
        order: 2;
        width: 100%;
        text-align: center;
    }

    .sticky-product-price {
        order: 3;
    }

    .sticky-add-to-cart-button {
        order: 4;
        width: 100%;
    }
}

/* Стили для виджета фильтра по цене */
.price-filter-widget {
    padding: 20px;
    border-radius: 8px;
}

.price-filter-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
}

.price-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.price-filter-button {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 14px;
}

.price-filter-button:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.price-filter-button.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Адаптивность */
@media (max-width: 768px) {
    .price-filter-buttons {
        flex-direction: column;
    }
    
    .price-filter-button {
        width: 100%;
    }
}

/* Стили для продвинутой галереи товара */
.product-gallery-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
}

/* Вертикальная галерея */
.gallery-layout-vertical {
    flex-direction: row;
}

.gallery-layout-vertical.thumbnails-position-left {
    flex-direction: row;
}

.gallery-layout-vertical.thumbnails-position-right {
    flex-direction: row-reverse;
}

.gallery-layout-vertical .product-gallery-thumbnails {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    width: 100px;
    flex-shrink: 0;
    overflow: hidden;
}

.gallery-layout-vertical .gallery-thumbnails-slider {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.3s ease;
}

.gallery-layout-vertical .gallery-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    cursor: pointer;
}

.gallery-layout-vertical .gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0px;
    transition: none;
    border-radius: 1em;
}

/* Горизонтальная галерея */
.gallery-layout-horizontal {
    flex-direction: column;
}

/* Позиционирование миниатюр в горизонтальном режиме */
.gallery-layout-horizontal.thumbnails-position-left {
    flex-direction: column;
}

.gallery-layout-horizontal.thumbnails-position-left .product-gallery-thumbnails {
    order: 1;
}

.gallery-layout-horizontal.thumbnails-position-left .product-gallery-main {
    order: 2;
}

.gallery-layout-horizontal.thumbnails-position-right {
    flex-direction: column;
}

.gallery-layout-horizontal.thumbnails-position-right .product-gallery-thumbnails {
    order: 2;
}

.gallery-layout-horizontal.thumbnails-position-right .product-gallery-main {
    order: 1;
}

.gallery-layout-horizontal .product-gallery-thumbnails {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.gallery-layout-horizontal .gallery-thumbnails-slider {
    display: flex;
    flex-direction: row;
    gap: 10px;
    transition: transform 0.3s ease;
}

.gallery-layout-horizontal .gallery-thumbnail {
    width: 100px;
    aspect-ratio: 1;
    flex-shrink: 0;
    cursor: pointer;
}

.gallery-layout-horizontal .gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.gallery-layout-horizontal .gallery-thumbnail.active img {
    border-color: #000;
}

/* Кнопки навигации */
.gallery-nav-button {
    position: absolute;
    z-index: 2;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.gallery-nav-button:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Позиционирование кнопок для вертикального режима */
.gallery-layout-vertical .gallery-nav-prev {
    left: 50%;
    top: 5px;
    transform: translateX(-50%);
    background-color: #f1f1f1;
    color: #0D141C;
}

.gallery-layout-vertical .gallery-nav-next {
    left: 50%;
    bottom: 5px;
    transform: translateX(-50%);
    background-color: #f1f1f1;
    color: #0D141C;
}

/* Позиционирование кнопок для горизонтального режима */
.gallery-layout-horizontal .gallery-nav-prev {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-layout-horizontal .gallery-nav-next {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Основное изображение */
.product-gallery-main {
    position: relative;
    overflow: hidden;
    flex: 1;
}

.product-gallery-main img {
    height: 80vh !important;
    object-fit: cover !important;
    width: 100%;
    display: flex;
    border-radius: 2em;
    max-height: 80vh;
    min-width: 660px;
}

.gallery-image {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image.active {
    display: block;
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 767px) {
    .gallery-layout-vertical {
        flex-direction: column;
    }

    .gallery-layout-vertical .product-gallery-thumbnails {
        flex-direction: row;
        max-height: none;
        width: 100%;
    }

    .gallery-layout-vertical .gallery-thumbnails-slider {
        flex-direction: row;
    }

    .gallery-layout-horizontal .product-gallery-main,
    .gallery-layout-horizontal .product-gallery-thumbnails {
        order: 0;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-image.active {
    animation: fadeIn 0.3s ease;
}

/* Стили для бара бесплатной доставки в мини-корзине */
.free-shipping-bar {
    margin: 10px 0;
    padding: 0 15px;
}

.free-shipping-bar .progress-bar {
    height: 6px;
    background: #f1f1f1;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.free-shipping-bar .progress-bar-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

.free-shipping-bar .progress-text {
    font-size: 0.7em;
    color: #f1f1f1;
    text-align: center;
    margin-top: 5px;
    font-family: 'Manrope';
    font-weight: 400;
}

.free-shipping-bar .progress-text.achieved {
    color: #f1f1f1;
    font-weight: 500;
}

/* Стили для мини-корзины */
.widget_shopping_cart_content {
    padding: 15px;
}

.widget_shopping_cart_content .woocommerce-mini-cart {
    margin: 0;
    padding: 0;
}

.widget_shopping_cart_content .woocommerce-mini-cart__total {
    margin: 10px 0;
    padding: 10px 0;
    border-top: 1px solid #f1f1f1;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons {
    margin: 0;
    padding: 0;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a {
    display: block;
    text-align: center;
    margin: 5px 0;
    padding: 10px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a.checkout {
    background: #4CAF50;
    color: #fff;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a.checkout:hover {
    background: #45a049;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a:not(.checkout) {
    background: #f1f1f1;
    color: #333;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a:not(.checkout):hover {
    background: #e1e1e1;
}