/*
Theme Name: 404raf
Template: storefront
*/

/* Базовые стили */
body {
    background: white;
    color: black;
    font-family: 'Helvetica', 'Arial', sans-serif !important;
}

/* Скрываем всё лишнее (поиск, меню, крошки, сортировку) */
.site-search,
.storefront-product-search,
.widget_product_search,
.secondary-navigation,
.main-navigation,
.storefront-breadcrumb,
.woocommerce-breadcrumb,
.woocommerce-result-count,
.woocommerce-ordering,
.storefront-sorting {
    display: none !important;
}

/* Хедер */
.custom-header-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    position: relative !important;
    min-height: 120px !important;
}

.site-3d-logo {
    width: 120px !important;
    height: 120px !important;
}

.custom-header-wrapper .site-header-cart {
    display: block !important;
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    list-style: none !important;
}

/* Скрываем заголовок страницы "Product" и лишние отступы под ним */
.woocommerce-products-header,
.woocommerce-products-header__title,
.page-title {
    display: none !important;
}

/* Список товаров - по 4 в ряд для компактного размера */
ul.products li.product {
    width: 22% !important;
    margin: 0 4% 40px 0 !important;
    float: left !important;
    clear: none !important;
}

ul.products li.product:nth-child(4n) {
    margin-right: 0 !important;
}

ul.products li.product:nth-child(4n+1) {
    clear: both !important;
}

/* Скрываем ЛЮБЫЕ дубли названий и цен, которые тема сует выше картинки */
ul.products li.product .woocommerce-LoopProduct-link {
    display: flex !important;
    flex-direction: column !important;
}

/* Название товара под картинкой */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2 {
    order: 2 !important; /* Ставим после картинки */
    text-align: left !important;
    color: #000 !important;
    font-weight: 700 !important;
    font-size: 24px !important;
    margin: 20px 0 5px 0 !important;
    padding: 0 !important;
    text-decoration: none !important;
}

/* Цена под названием */
ul.products li.product .price {
    order: 3 !important; /* Ставим после названия */
    text-align: left !important;
    color: #000 !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    margin: 0 !important;
    display: block !important;
}

/* Сама картинка */
ul.products li.product img {
    order: 1 !important; /* Картинка всегда первая */
    margin-bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
}

/* Убираем фиолетовые ссылки */
a, a:hover, a:visited {
    color: #000 !important;
    text-decoration: none !important;
}

/* Корзина (фикс выпадайки) */
.site-header-cart .widget_shopping_cart {
    background: #fff !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    width: 300px !important;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 100%;
    right: 0;
    transition: 0.2s;
}

.site-header-cart:hover .widget_shopping_cart {
    opacity: 1;
    visibility: visible;
}

/* Ссылки в футере */
.footer-bottom-links {
    text-align: center !important;
    width: 100% !important;
    margin-top: 40px !important;
    padding-bottom: 20px !important;
    clear: both !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
}

.footer-bottom-links a {
    text-transform: uppercase !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    color: #666 !important;
    transition: color 0.2s !important;
    text-decoration: none !important;
}

.footer-bottom-links .separator {
    color: #ccc !important;
    font-size: 14px !important;
}

.footer-bottom-links a:hover {
    color: #000 !important;
}

/* Прелоадер */
#site-preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #fff;
    display: flex; justify-content: center; align-items: center;
    z-index: 999999;
}
#site-preloader img { width: 250px; }
