/*
 * Стили для плагина Bagon Custom Cart
 */

/* === Переменные и базовые стили === */
:root {
    --main-color: #fbd38d; 
    --main-text-color: #333; 
    --accent-color: #d63638; 
    --border-color: #eee; 
    --background-color-light: #fff; 
    --font-family: 'Rubik', sans-serif;
}

/* === Кнопка корзины в шапке === */
.custom-cart-wrapper {
    position: relative;
    text-align: left;
    font-family: var(--font-family);
}

.custom-cart-link {
    display: block;
    background-color: var(--main-color);
    color: var(--main-text-color);
    border: none;
    padding: 5px 10px;
    font-weight: 400; 
    cursor: pointer;
    border-radius: 4px;
    min-width: 100px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.custom-cart-link:hover {
    background-color: #fbd38d; 
    transform: translateY(-2px);
}

.custom-cart-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.custom-cart-content .cart-title {
    font-size: 14px;
    font-weight: 400; 
    line-height: 1;
    color: var(--main-text-color);
}

.custom-cart-content .cart-items {
    font-size: 14px;
    font-weight: normal;
    color: #555;
    line-height: 1.3;
}

.custom-cart-content .cart-total {
    font-size: 16px;
    font-weight: 400;
    color: #000000;
    line-height: 1.5;
}

.custom-cart-content .cart-total.hidden {
    display: none;
}

/* === Мини-корзина (динамическая) === */
.custom-mini-cart {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #2d2d2d !important;
    opacity: 1 !important;
    color: #df5959;
    border: 0px solid #fbd38d4a;
    border-radius: 15px;
    box-shadow: 9px 9px 14px 2px rgb(20 20 20);
    z-index: 1000;
    width: fit-content;
    min-width: 280px;
    max-width: 90vw;
    padding: 10px;
    margin-top: 20px;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d8c281 #f1f1f1;
    font-family: var(--font-family);
}

.custom-mini-cart.static-mini-cart {
    position: static; 
    display: block; 
    width: 100%; 
    max-width: 100%; 
    min-width: 0; 
    margin: 0; 
    box-shadow: none; 
    border-radius: 12px; 
    background-color: var(--background-color-light);
}

.custom-mini-cart::-webkit-scrollbar {
    width: 8px;
}

.custom-mini-cart::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-mini-cart::-webkit-scrollbar-thumb {
    background-color: #d8c281;
    border-radius: 4px;
}

/* === Контейнер кнопок сверху === */
.custom-mini-cart-header-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 0px;
}

.custom-mini-cart-header-buttons .button {
    flex: 1;
    text-align: left;
    padding: 10px;
    border-radius: 8px;
    font-weight: 400; 
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.custom-mini-cart-header-buttons .button.checkout {
    background-color: #5e7db5;
    color: #000000;
    font-weight: 300;
    text-align: center;
}

.custom-mini-cart-header-buttons .button.wc-forward {
    display: none !important; 
}

.custom-mini-cart-header-buttons .button.checkout:hover {
    background-color: #6e93d6;
    color: #ffffff;
    transform: translateY(-2px);
    text-align: center;
}

.custom-mini-cart-header-buttons .clear-cart-button {
background-color: #4f4f4f9c;
    color: #777777;
    font-weight: 300;
    border: none;
    text-align: center;
}

.custom-mini-cart-header-buttons .clear-cart-button:hover {
    background-color: #774646;
    transform: translateY(-2px);
    color: #ffffff;
}

/* === Товары в корзине === */
.woocommerce-mini-cart {
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-mini-cart .woocommerce-mini-cart-item {
    margin-bottom: 2px;
    background-color: #2d2d2d !important;
    border-radius: 10px;
    padding-left: 15px;
    padding-right: 15px;
    transition: background-color 0.3s ease;
}

.custom-mini-cart .woocommerce-mini-cart-item:hover {
    background-color: #3b3b3b !important;
}

/* ======================================================= */
/* === СТИЛИЗАЦИЯ СТАНДАРТНЫХ ВАРИАЦИЙ (DL/DT/DD) === */
/* ======================================================= */

/* Контейнер для вариаций */
.custom-mini-cart dl.variation {
    display: flex;
    flex-wrap: wrap; /* Позволяет перенос строк */
    margin: 0;
    padding-left: 8px;
    border-left: 1px solid #444; /* Линия слева как в конфигураторе */
    margin-top: 4px;
}

/* Название атрибута (Label) */
.custom-mini-cart dl.variation dt {
    float: none;
    clear: none;
    margin: 0 4px 0 0;
    padding: 0;
    font-weight: normal !important; /* Убираем жирность */
    color: #afafaf; /* Серый цвет */
    font-size: 11px;
    display: inline-block;
}

/* Значение атрибута (Value) */
.custom-mini-cart dl.variation dd {
    float: none;
    margin: 0 0 2px 0; /* Небольшой отступ снизу для следующей строки */
    padding: 0;
    font-weight: normal !important; /* Убираем жирность */
    color: #e0e0e0; /* Светлый текст */
    font-size: 11px;
    display: inline-block;
    width: 100%; /* Заставляет следующий элемент перенестись на новую строку, если нужно блочное отображение */
    /* Или width: auto; display: inline; если хотите все в одну строку */
}

/* Если нужно построчное отображение: Label: Value (новая строка) */
.custom-mini-cart dl.variation {
    display: grid;
    grid-template-columns: auto 1fr; /* Label (auto width) | Value (rest) */
    column-gap: 6px;
    row-gap: 2px;
}

.custom-mini-cart dl.variation dt {
    grid-column: 1;
    display: flex;
    align-items: center;
}

.custom-mini-cart dl.variation dd {
    grid-column: 2;
    margin: 0;
    display: flex;
    align-items: center;
}

/* Убиваем отступы у параграфов внутри вариаций, которые создает Woo */
.custom-mini-cart dl.variation dd p {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    display: inline;
}
/* ======================================================= */


/* Кнопка удаления */
.cart-table a.remove {
    font-size: 1.5em;
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    position: relative;
    margin-right: 10px; 
}

.cart-table a.remove:hover {
    color: #f90000;
}

/* Изображение */
.cart-table img {
    width: 60px;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
}

/* Название товара */
.cart-table a.product-name {
    color: var(--main-text-color);
    text-decoration: overline;
    font-weight: 400; 
    font-size: 16px;
    white-space: nowrap; 
    overflow: visible; 
}

.cart-table a.product-name:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.cart-table .woocommerce-Price-amount {
    font-weight: 100;
    color: #e7e7e7;
    font-size: 14px;
    margin-left: 16px;
    text-shadow: 2px 2px 4px #000000;
}

/* Итоговая сумма */
.woocommerce-mini-cart__total {
    text-align: right;
    padding: 5px 0;
    font-weight: 400; 
    font-size: 16px;
    color: var(--main-text-color);
}

.woocommerce-mini-cart__total strong {
    color: #bdbdbd !important;
    font-weight: normal; 
}

.woocommerce-mini-cart__total .woocommerce-Price-amount {
    color: #fbd38d;
    text-shadow: 2px 2px 4px #000000;
}

.woocommerce-mini-cart__empty-message {
    text-align: left;
    padding: 20px;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 16px;
}

.woocommerce-mini-cart__buttons {
    display: none;
}

.scrolled .custom-mini-cart:not(.static-mini-cart) {
    top: 100%; 
    margin-bottom: 8px;
    opacity: 1 !important;
    background-color: #2d2d2d !important;
}

/* === Адаптивность для мобильных устройств === */
@media (max-width: 768px) {
    .custom-cart-link {
        padding: 5px 5px; 
        min-width: 80px; 
    }
    
    .cart-table .name-column {
        white-space: normal;      
        overflow-wrap: break-word; 
    }

    .custom-cart-content .cart-title,
    .custom-cart-content .cart-items {
        font-size: 13px; 
    }

    .custom-mini-cart:not(.static-mini-cart) {
        width: 80vw;
        max-width: 400px; 
        transform: translateX(-5%);
        padding: 10px;
    }

    .custom-mini-cart-header-buttons {
        gap: 10px; 
    }

    .custom-mini-cart-header-buttons .button {
        padding: 8px 12px; 
        font-size: 13px; 
    }

    .custom-mini-cart .woocommerce-mini-cart-item {
        padding-left: 10px;
        padding-right: 10px;
    }

    .cart-table {
        gap: 10px; 
    }

    .cart-table .image-column {
        flex: 0 0 50px; 
        margin-right: 10px;
    }

    .cart-table img {
        width: 50px; 
    }

    .cart-table a.product-name {
        font-size: 15px; 
        white-space: normal; 
        line-height: 1.2;
    }

    .cart-table dl.variation,
    .cart-table .quantity {
        font-size: 12px; 
    }
    
    .cart-table .price-column {
        white-space: nowrap; 
    }

    .cart-table .woocommerce-Price-amount {
        font-size: 13px; 
    }
    
    .woocommerce-mini-cart__total {
        font-size: 15px; 
        padding: 10px 0;
    }
}

.floating-icon-wrapper.scrolled .custom-mini-cart {
    top: 100%;      
    bottom: auto;   
    right: 0;       
    margin-top: 5px; 
}

.custom-cart-content {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    flex-direction: row;
}

.cart-text-wrapper {
    display: flex;
    flex-direction: column; 
    line-height: 1.2; 
}

.cart-arrow {
    font-size: 12px;
    line-height: 1;
    color: #2c2c2c; 
}

.cart-items, .cart-total {
    display: block;
}

.mini-cart-product-item {
    position: relative;
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
}
.mini-cart-product-item .attachment-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    
}
.mini-cart-product-item .magnifier-icon {
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    width: 28px;
    height: 28px;
  /*  background-color: rgba(29, 29, 29, 0.6);*/
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.2s ease-in-out;
}
.mini-cart-product-item:hover .magnifier-icon {
    opacity: 1;
}

@media (max-width: 768px) {
    .cart-table .mini-cart-product-item {
        width: 50px;
        height: 50px;
    }
}

/* ========================================================================= */
/* === FIX: ПРИНУДИТЕЛЬНЫЙ СБРОС СТИЛЕЙ ТЕМЫ/WOOCOMMERCE ДЛЯ ИЗОБРАЖЕНИЙ === */
/* ========================================================================= */

.custom-mini-cart .mini-cart-product-item img, 
.custom-mini-cart ul.product_list_widget li img,
.custom-mini-cart ul.cart_list li img {
    float: none !important;        /* Отключаем обтекание справа */
    margin: 0 !important;          /* Убираем внешние отступы */
    width: 100% !important;        /* Картинка должна заполнять наш контейнер 60px */
    height: 100% !important;       /* И высоту контейнера */
    box-shadow: none !important;   /* Убираем возможные тени темы */
    position: static !important;
}


/* === Bagon Custom Cart: Замена списка товаров в Checkout Block === */

/* 1. Скрываем стандартный список товаров WooCommerce Blocks */
.wp-block-woocommerce-checkout-order-summary-cart-items-block {
    display: none;
}

/* 2. Стили для нашего внедренного контейнера на чекауте */
.bagon-checkout-replacement-wrapper {
    margin-bottom: 24px;
    border-bottom: 0px solid rgba(255,255,255,0.04);
    padding-bottom: 20px;
}