/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* ==========================================================================
   Единая страница оформления заказа (One-Page Checkout) & Мини-корзина
   ========================================================================== */

/* 1. Мини-корзина в шапке (одна кнопка "Оформить заказ") */
.woocommerce-mini-cart__buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding-top: 15px !important;
    margin: 0 !important;
}

.woocommerce-mini-cart__buttons .button.checkout,
.woocommerce-mini-cart__buttons .ct-btn-checkout-single {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 48px !important;
    grid-column: 1 / -1 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-radius: 8px !important;
    background-color: var(--theme-palette-color-1, #055188) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(5, 81, 136, 0.2) !important;
}

.woocommerce-mini-cart__buttons .button.checkout:hover,
.woocommerce-mini-cart__buttons .ct-btn-checkout-single:hover {
    background-color: var(--theme-palette-color-2, #346487) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 81, 136, 0.3) !important;
}

/* 2. Заголовки секций на Checkout */
.woocommerce-billing-fields h3,
#order_review_heading {
    font-size: 19px !important;
    font-weight: 700 !important;
    color: var(--theme-headings-color, #1e293b) !important;
    margin-bottom: 20px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid var(--theme-border-color, #e2e8f0) !important;
    letter-spacing: -0.01em;
}

/* 3. Поля формы оформления заказа: строгое скрытие лишнего */
#billing_phone_field,
#shipping_phone_field,
#billing_country_field,
#shipping_country_field,
#billing_state_field,
#shipping_state_field,
#billing_address_2_field,
#shipping_address_2_field,
#billing_company_field,
#shipping_company_field,
.woocommerce-additional-fields,
#order_comments_field {
    display: none !important;
}

/* 4. Чёткая 2-колоночная сетка для парных полей */
@media (min-width: 600px) {
    /* Строка 1: Фамилия (слева) + Имя (справа) */
    #billing_last_name_field {
        float: left !important;
        width: 48% !important;
        margin-right: 4% !important;
        margin-bottom: 18px !important;
        clear: both !important;
    }
    #billing_first_name_field {
        float: right !important;
        width: 48% !important;
        margin-right: 0 !important;
        margin-bottom: 18px !important;
        clear: none !important;
    }

    /* Строка 2: Email (на всю ширину) */
    #billing_email_field {
        float: none !important;
        width: 100% !important;
        clear: both !important;
        margin-bottom: 18px !important;
    }

    /* Строка 3: Индекс (слева) + Населённый пункт (справа) */
    #billing_postcode_field {
        float: left !important;
        width: 48% !important;
        margin-right: 4% !important;
        margin-bottom: 18px !important;
        clear: both !important;
    }
    #billing_city_field {
        float: right !important;
        width: 48% !important;
        margin-right: 0 !important;
        margin-bottom: 18px !important;
        clear: none !important;
    }

    /* Строка 4: Адрес (на всю ширину) */
    #billing_address_1_field {
        float: none !important;
        width: 100% !important;
        clear: both !important;
        margin-bottom: 18px !important;
    }
}

.woocommerce-billing-fields__field-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* 5. Список товаров в составе заказа */
.woocommerce-checkout-review-order-table .product-name {
    padding-right: 15px;
}

.ct-checkout-product-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ct-checkout-product-thumbnail {
    flex-shrink: 0;
}

.ct-checkout-product-thumbnail img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--theme-border-color, #e2e8f0);
    display: block;
}

.ct-checkout-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.ct-checkout-product-title,
.ct-checkout-product-title a {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    color: var(--theme-headings-color, #2c3e50);
    text-decoration: none;
}

.ct-checkout-product-title a:hover {
    color: var(--theme-palette-color-1, #055188);
}

.ct-checkout-qty-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.ct-checkout-qty-btn {
    width: 28px;
    height: 28px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--theme-border-color, #cbd5e1);
    background: #f8fafc;
    color: #334155;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    padding: 0;
    transition: all 0.15s ease;
}

.ct-checkout-qty-btn:hover {
    background: var(--theme-palette-color-1, #055188);
    color: #ffffff;
    border-color: var(--theme-palette-color-1, #055188);
}

.ct-checkout-qty-val {
    font-size: 13px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    color: #1e293b;
}

.ct-checkout-remove-btn {
    margin-left: 6px;
    font-size: 20px;
    line-height: 1;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.ct-checkout-remove-btn:hover {
    color: #ef4444;
}

/* 6. Способы доставки: современные карточки выбора */
ul#shipping_method {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 !important;
    padding: 0;
    list-style: none;
}

ul#shipping_method li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--theme-border-color, #e2e8f0);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

ul#shipping_method li:hover {
    border-color: var(--theme-palette-color-1, #055188);
    background: #f8fafc;
}

ul#shipping_method li:has(input:checked) {
    border-color: var(--theme-palette-color-1, #055188);
    background: rgba(5, 81, 136, 0.04);
    box-shadow: 0 0 0 1px var(--theme-palette-color-1, #055188);
}

ul#shipping_method li label {
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--theme-text-color, #334155);
}

.woocommerce-shipping-destination {
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 6px;
    border-left: 3px solid var(--theme-palette-color-1, #055188);
}

/* 7. Sticky правая колонка (состав заказа) на десктопе */
@media (min-width: 992px) {
    .ct-order-review {
        position: sticky;
        top: 30px;
        align-self: start;
    }
}
