#ac-custom-checkout-wrapper, .ac-address-manager {
    max_width: 800px;
    margin: 0 auto;
    background: var(--global-bg, #fff);
}
.ac-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
.ac-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-transform: uppercase;
}
.ac-radio-group { display: flex; gap: 15px; }
.ac-radio-card {
    flex: 1;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
    background: #fff;
}
.ac-radio-card:hover { border-color: var(--global-accent, #007cba); }
.ac-radio-card input { display: none; }
.ac-radio-card input:checked + span { color: var(--global-accent, #007cba); font-weight: bold; }

.ac-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background: #fff;
    color: #333;
}
textarea.ac-input { resize: vertical; }
select.ac-input { height: 42px; }

.ac-dynamic-block {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.ac-sub-block { margin-top: 15px; padding-top: 15px; border-top: 1px solid #e5e5e5; }
.ac-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media(max-width: 500px) { .ac-row-2 { grid-template-columns: 1fr; } }

/* BUTTONS */
.ac-submit-btn, .ac-address-manager .button-primary {
    width: 100%;
    padding: 15px;
    background-color: var(--btn-bg, #222) !important; 
    color: var(--btn-text, #fff) !important;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 4px;
    /*margin-top: 10px;*/
}
.ac-submit-btn:hover, .ac-address-manager .button-primary:hover {
    background-color: var(--btn-bg-hover, #007cba) !important; 
    color: var(--btn-text-hover, #fff) !important;
    opacity: 1 !important;
}
.ac-submit-btn:disabled { background-color: #ccc !important; cursor: not-allowed; }

/* Manager Styles */
.ac-address-card {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 4px;
    position: relative;
}
.ac-is-default { border-color: #4ab866; background: #f0f9f2; }
.ac-badge-default { background: #4ab866; color: #fff; font-size: 0.75rem; padding: 2px 6px; border-radius: 3px; margin-left: 8px; }

.ac-addr-actions { display: flex; gap: 10px; }
.ac-btn-edit { background: #eee; border: none; padding: 5px 10px; cursor: pointer; border-radius: 3px; }
.ac-btn-edit:hover { background: #ddd; }
.ac-btn-remove { background: #ffecec; border: none; color: #e74c3c; padding: 5px 10px; cursor: pointer; border-radius: 3px; }
.ac-btn-remove:hover { background: #ffcccc; }

.ac-saved-selector { margin-bottom: 25px; padding: 15px; background: #eef5fa; border-radius: 4px; }
#ac-save-new-addr-wrap { 
    background: #fff; 
    padding: 10px; 
    border: 1px dashed #007cba; 
    border-radius: 4px; 
}
.ac-delivery-payment-block {
    background: #fff8e1;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffe082;
}

/* === V2.2: РАДИКАЛЬНЕ ПРИХОВУВАННЯ СТАРИХ АДРЕС === */

/* Ховаємо стандартний контейнер деталей клієнта, АЛЕ НЕ наш (з класом ac-custom...) */
/*.woocommerce-order-details .woocommerce-customer-details:not(.ac-custom-order-details) {*/
/*    display: none !important;*/
/*}*/
section.woocommerce-customer-details {
    display: none !important;
}
/* На всяк випадок ховаємо нутрощі, якщо тема використовує інші обгортки */
.woocommerce-order-details .woocommerce-columns--addresses,
.woocommerce-order-details .col2-set.addresses,
.woocommerce-order-details address:not(.ac-custom-address) { /* Додав клас-виключення */
    display: none !important;
}

/* Стилізація нашого блоку в особистому кабінеті */
section.ac-custom-order-details {
    display: block !important;
    width: 100%;
    margin-top: 30px;
    margin-bottom: 30px;
}

section.ac-custom-order-details address.ac-custom-address {
    display: block !important;
    font-style: normal;
    border: 1px solid #e5e5e5;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
}
/* --- Styling for New Product Table Columns (v2.7) --- */

.ac-order-review-section {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    background: #fcfcfc;
    margin-top: 25px; 
}

.ac-order-review-section h3 {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.ac-order-review {
    width: 100%;
    border-collapse: collapse;
}

/* Стилі для шапки таблиці */
.ac-order-review thead th {
    font-size: 0.95rem;
    font-weight: 600;
    padding-bottom: 12px !important;
    padding-top: 0;
    vertical-align: bottom;
    border: none;
    border-bottom: 2px solid #ddd;
}

.ac-order-review tbody td {
    padding: 10px 0;
    border: none;
    border-bottom: 1px dashed #eee;
    vertical-align: middle; /* Вирівнюємо вміст по середині */
}

/* Мініатюра */
.ac-order-review .product-thumb {
    width: 60px; 
    padding-left: 0;
    padding-right: 10px;
}

.ac-checkout-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
}

/* Артикул */
.ac-order-review .product-sku {
    width: 10%;
    font-size: 0.9em;
}

.ac-order-review th.product-sku {
    font-weight: bold;
}

.ac-order-review td.product-sku {
    color: #1e293b;
}

/* Ціна за шт. */
.ac-order-review .product-price-unit {
    width: 15%;
    font-size: 0.95em;
    font-weight: 500;
    white-space: nowrap;
}

/* Кількість */
.ac-order-review .product-quantity {
    width: 5%;
    font-weight: bold;
}

/* Назва товару */
.ac-order-review .product-name {
    padding-right: 15px;
}


/* Стилі для підсумків */
.ac-order-review tfoot tr {
    border-top: 2px solid #ddd;
}

.ac-order-review tfoot th {
    text-align: right; 
}

.ac-order-review tfoot th,
.ac-order-review tfoot td {
    padding-top: 15px;
    font-size: 1.1em;
}

/* Кнопка "Повернутися до кошика" */
.ac-cart-actions {
    margin-bottom: 20px;
    text-align: right; 
}

.ac-btn-back-to-cart {
    background: #f5f5f5;
    color: #555 !important; 
    border: 1px solid #ccc;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: 0.2s;
    display: inline-block; 
}

.ac-btn-back-to-cart:hover {
    background: #e9e9e9;
    color: #333 !important;
    border-color: #999;
}

/* Ховаємо "Арт:" на десктопі (бо є шапка таблиці) */
.ac-sku-label {
    display: none;
}

.ac-order-review .product-thumb .fw-zoom-trigger {
    bottom: 10px;
    width: calc(100% - 10px);
    height: calc(100% - 20px);
}
/* ==========================================================
   АДАПТИВНІСТЬ ТАБЛИЦІ ЗАМОВЛЕННЯ (Мобільні та Планшети)
   ========================================================== */
@media (max-width: 992px) {
    /* Приховуємо стандартну шапку таблиці */
    .ac-order-review thead {
        display: none;
    }

    /* Відміняємо табличне відображення */
    .ac-order-review,
    .ac-order-review tbody,
    .ac-order-review tfoot,
    .ac-order-review tr,
    .ac-order-review th,
    .ac-order-review td {
        display: block;
        width: 100%;
    }

    /* Стилізуємо рядок товару як гнучку картку */
    .ac-order-review tbody tr.ac-order-item {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 15px;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        margin-bottom: 15px;
        background: #fff;
    }

    /* Прибираємо стандартні відступи та бордери */
    .ac-order-review tbody td {
        border: none;
        padding: 5px 0;
    }

    /* 1. Мініатюра зліва */
    .ac-order-review .product-thumb {
        width: 60px;
        margin-right: 15px;
        padding: 0;
    }
    .ac-order-review .product-thumb .fw-zoom-trigger {
    bottom: 0;
    height: 100%;
}
    /* 2. Назва товару поруч з мініатюрою */
    .ac-order-review .product-name {
        width: calc(100% - 75px);
        font-weight: 600;
        font-size: 15px;
        padding: 0;
        line-height: 1.3;
    }

    /* 3. Артикул під назвою */
    .ac-order-review .product-sku {
        width: 100%;
        padding-left: 75px; /* Вирівнюємо по тексту, минаючи картинку */
        margin-top: -10px;
        margin-bottom: 15px;
        text-align: left !important;
    }
    /* Показуємо "Арт:" на мобільних пристроях */
    .ac-sku-label {
        display: inline;
        color: #64748b; /* Можеш змінити колір, якщо треба */
    }
    /* 4. Блок Ціна / К-ть / Сума (ділимо на 3 рівні колонки внизу картки) */
    .ac-order-review .product-price-unit,
    .ac-order-review .product-quantity,
    .ac-order-review .product-total {
        width: 33.33%;
        display: flex;
        flex-direction: column;
        font-size: 13px;
        background: #f8fafc; /* Легкий фон для виділення блоку з цифрами */
        padding: 10px 3px !important;
        border-top: 1px solid #e2e8f0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        box-sizing: border-box;
    }

    /* Закруглення і рамки для цього цифрового блоку */
    .ac-order-review .product-price-unit {
        border-left: 1px solid #e2e8f0 !important;
        border-radius: 6px 0 0 6px;
        text-align: left;
    }

    .ac-order-review .product-quantity {
        text-align: center !important;
        align-items: center;
        border-left: 1px solid #e2e8f0 !important;
        border-right: 1px solid #e2e8f0 !important;
    }

    .ac-order-review .product-total {
        border-right: 1px solid #e2e8f0 !important;
        border-radius: 0 6px 6px 0;
        text-align: right !important;
        align-items: flex-end;
        font-weight: 700;
        color: var(--global-accent, #007cba);
    }

    /* Додаємо підписи через псевдоелементи (бо шапку ми сховали) */
    .ac-order-review .product-price-unit::before {
        content: "Ціна/шт.";
        font-size: 11px;
        color: #64748b;
        margin-bottom: 4px;
        font-weight: normal;
    }

    .ac-order-review .product-quantity::before {
        content: "Кількість";
        font-size: 11px;
        color: #64748b;
        margin-bottom: 4px;
        font-weight: normal;
    }

    .ac-order-review .product-total::before {
        content: "Сума";
        font-size: 11px;
        color: #64748b;
        margin-bottom: 4px;
        font-weight: normal;
    }

    /* 5. Підсумки (До сплати) */
    .ac-order-review tfoot {
        margin-top: 10px;
    }
    .ac-order-review tfoot tr.order-total {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f0f9ff;
        padding: 15px;
        border-radius: 6px;
        border: 1px solid #bae6fd;
    }
    .ac-order-review tfoot th {
        width: auto;
        border: none;
        padding: 0;
        font-size: 16px;
    }
    .ac-order-review tfoot td {
        width: auto;
        border: none;
        padding: 0;
        text-align: right !important;
        font-size: 18px;
        color: #0369a1;
    }
}