/* =====================================================================
   VDTabernam customizations
   ===================================================================== */

/* ---------- Cart buttons (Task #6) ---------- */

/* Каталог: круглая icon-only кнопка корзины */
.woocommerce ul.products li.product .vdt-loop-cart-btn,
ul.products li.product .vdt-loop-cart-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #1a1a1a;
    border: 1.5px solid #1a1a1a;
    box-shadow: none;
    transition: background .15s ease, color .15s ease, transform .15s ease;
    margin: 8px 12px 8px auto;
    float: right;
}

.vdt-loop-cart-btn:hover,
.vdt-loop-cart-btn:focus {
    background: #1a1a1a;
    color: #fff;
    transform: scale(1.05);
}

.vdt-loop-cart-btn .vdt-cart-icon {
    width: 22px;
    height: 22px;
    display: block;
}

/* Когда товар добавляется (ajax loading-state) */
.vdt-loop-cart-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}
.vdt-loop-cart-btn.added::after {
    content: '✓';
    position: absolute;
    transform: translate(20px, -16px);
    background: #2dbf64;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
}

/* Страница товара: широкая кнопка с иконкой (через ::before) + текстом */
.single-product .single_add_to_cart_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 999px;
    background: #fff;
    color: #1a1a1a;
    border: 1.5px solid #1a1a1a;
    transition: background .15s ease, color .15s ease;
}

.single-product .single_add_to_cart_button::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 6px;
    background: currentColor;
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='21' r='1'/><circle cx='20' cy='21' r='1'/><path d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='21' r='1'/><circle cx='20' cy='21' r='1'/><path d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/></svg>");
    -webkit-mask-size: contain;
            mask-size: contain;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
}

.single-product .single_add_to_cart_button:hover {
    background: #1a1a1a;
    color: #fff;
}

/* ---------- Custom badges (Task #5) ---------- */

.vdt-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    pointer-events: none;
}

ul.products li.product,
.single-product div.product {
    position: relative;
}

.vdt-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    border-radius: 4px;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,.1);
    letter-spacing: .02em;
}

.vdt-badge-sale50    { background: #ed3833; }
.vdt-badge-promo     { background: #ed3833; }
.vdt-badge-new       { background: #3b82f6; }
.vdt-badge-clearance { background: #ed3833; }
.vdt-badge-ending    { background: #f59e0b; }

/* Подавляем стандартный WooCommerce sale-flash чтобы не дублировался с нашими бейджами */
ul.products li.product .onsale,
.single-product .onsale { display: none !important; }

/* В админке (колонка списка товаров) */
.vdt-badge-admin {
    display: inline-block;
    padding: 2px 6px;
    margin: 1px 2px;
    font-size: 11px;
    border-radius: 3px;
    color: #fff;
}
.vdt-badge-admin.vdt-badge-sale50    { background: #ed3833; }
.vdt-badge-admin.vdt-badge-promo     { background: #ed3833; }
.vdt-badge-admin.vdt-badge-new       { background: #3b82f6; }
.vdt-badge-admin.vdt-badge-clearance { background: #ed3833; }
.vdt-badge-admin.vdt-badge-ending    { background: #f59e0b; }

/* ---------- Mobile menu: hide duplicate cart link from theme ---------- */
/* Тема выводит свой "Товарів: X шт." — но мы уже выводим "Мій кошик".
   Прячем оригинальный, чтобы не дублировались. */
.mobile-menu__section .yith-wacp-mini-cart,
.mobile-menu__section [id^="yith-wacp-mini-cart"],
.mobile-menu__section .ec-cart-counter-section,
.mobile-menu__section [class*="cart-customlocation"] {
    display: none !important;
}

/* ---------- Mobile menu: cart link replacing wishlist (Task #7) ---------- */

.vdt-mobile-cart {
    display: flex;
    align-items: center;
}

.vdt-mobile-cart-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
}

.vdt-mobile-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
}

.vdt-mobile-cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ed3833;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    line-height: 18px;
    text-align: center;
}

/* ---------- Menu: Каталог товарів button (Task #7) ---------- */

.vdt-catalog-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: calc(100% - 32px);
    margin: 16px;
    padding: 14px 20px;
    background: #2dbf64;
    color: #fff !important;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: background .15s ease;
}

.vdt-catalog-btn:hover,
.vdt-catalog-btn:focus {
    background: #259e51;
    color: #fff;
}

.vdt-catalog-btn svg {
    flex-shrink: 0;
}

/* ---------- Product page: promo block (Task #10) ---------- */

.vdt-promo-block {
    margin: 16px 0 20px;
    text-align: center;
    padding: 16px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}

.vdt-promo-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
}

.vdt-promo-countdown {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.vdt-cd-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
}

.vdt-cd-num {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: #1a1a1a;
}

.vdt-cd-label {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    text-transform: lowercase;
}

.vdt-cd-sep {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: #1a1a1a;
    align-self: flex-start;
    padding-top: 4px;
}

.vdt-promo-gift {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 0;
    padding: 8px 14px;
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 999px;
    font-size: 14px;
    color: #1a1a1a;
}

/* ---------- Product page: price block (Task #9) ---------- */

.vdt-price-block {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.vdt-price-old,
.vdt-price-new {
    display: flex;
    flex-direction: column;
}

.vdt-price-label {
    font-size: 13px;
    color: #6b7280;
}

.vdt-price-old .vdt-price-value {
    font-size: 22px;
    color: #9ca3af;
    text-decoration: line-through;
}

.vdt-price-new .vdt-price-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}

.vdt-price-arrow {
    font-size: 28px;
    color: #d1d5db;
    line-height: 1;
}

/* ---------- Quick order form (Task #9) ---------- */

.vdt-quick-order-form {
    margin: 24px 0 0;
    padding: 20px;
    background: #f3f4f6;
    border-radius: 12px;
}

.vdt-quick-order-form .ff-el-input--label,
.vdt-quick-order-form .ff_t_c {
    display: none !important;
}

.vdt-quick-order-form .ff-el-form-control {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    width: 100%;
    font-size: 15px;
}

.vdt-quick-order-form .ff-btn-submit {
    width: 100%;
    background: #1a73e8;
    color: #fff;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.vdt-quick-order-form .ff-btn-submit:hover {
    background: #1557b0;
}
