/* ── Сторінка кошика ──────────────────────────────────────────────────────── */

.cart-page {
    padding-block: 30px 80px;
}

.cart-page__breadcrumbs {
    margin-bottom: 20px;
}

/* Картка-обгортка (як на флоу) */
.cart-page__card {
    max-width: 1024px;
    margin-inline: auto;
}

.cart-page__title {
    font-family: var(--font-ui);
    font-size: 24px;
    font-weight: 500;
    line-height: 32px;
    color: var(--color-text);
    text-align: center;
    margin: 0 0 30px;
}


/* ── Нотиси WC (видалено товар / відновити тощо) ─────────────────────────── */

.cart-page .woocommerce-message,
.cart-page .woocommerce-info,
.cart-page .woocommerce-error {
    list-style: none;
    margin: 0 0 20px;
    padding: 14px 20px;
    border: 1px solid var(--color-border);
    border-left: 3px solid #5eb166;
    border-radius: var(--radius);
    background: #fff;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text);
}

.cart-page .woocommerce-error {
    border-left-color: var(--color-accent);
}

.cart-page .woocommerce-info {
    border-left-color: #009DE0;
}

.cart-page .woocommerce-message a,
.cart-page .woocommerce-info a,
.cart-page .woocommerce-error a {
    color: #009DE0;
}


/* ── Таблиця товарів ──────────────────────────────────────────────────────── */

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table__th {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    color: var(--color-text);
    text-align: left;
    padding: 0 10px 12px;
    border-bottom: 1px solid var(--color-border);
}

.cart-table__th--qty,
.cart-table__th--price {
    text-align: center;
}

.cart-table td {
    padding: 20px 10px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

/* Прибираємо border-top WC за замовчуванням: .woocommerce table.shop_table td */
.woocommerce table.shop_table td,
.woocommerce-page table.shop_table td {
    border-top: none !important;
}

/* Зображення */
.cart-table__thumb {
    width: 180px;
}

/* Специфічність вища за WC: .woocommerce-cart table.cart img {width:32px} */
.woocommerce-cart .cart-table .cart-table__thumb img,
.cart-table__thumb img {
    display: block;
    width: 150px;
    height: 150px;
    object-fit: contain;
}

/* Назва */
.cart-table__name-link {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition);
}

a.cart-table__name-link:hover {
    color: var(--color-accent);
}

/* Дані варіації під назвою */
.cart-table__name .variation {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--color-muted);
}

.cart-table__name .variation dt,
.cart-table__name .variation dd {
    margin: 0;
}

.cart-table__name .variation dd p {
    margin: 0;
    display: inline;
}

/* Артикул */
.cart-table__sku {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: var(--color-muted);
    white-space: nowrap;
}

/* Кількість: степер [−] [число] [+] */
.cart-table__qty {
    text-align: center;
}

.cart-table__qty .quantity {
    display: inline-flex;
    align-items: stretch;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-sizing: border-box;
}

.cart-table__qty .quantity__btn {
    width: 28px;
    border: none;
    background: none;
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1;
    color: #111;
    cursor: pointer;
    padding: 0;
    transition: background var(--transition);
}

.cart-table__qty .quantity__btn:hover {
    background: var(--color-bg-alt);
}

.cart-table__qty .quantity .qty {
    width: 42px;
    border: none;
    outline: none;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
    color: #111;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
}

.cart-table__qty .quantity .qty::-webkit-outer-spin-button,
.cart-table__qty .quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Ціна (підсумок рядка) */
.cart-table__price {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    color: var(--color-text);
    text-align: center;
    white-space: nowrap;
}

/* Видалити (×) */
.cart-table__remove {
    width: 40px;
    text-align: right;
}

.cart-table__remove a.remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    color: var(--color-muted);
    text-decoration: none;
    border-radius: 50%;
    transition: color var(--transition), background var(--transition);
}

.cart-table__remove a.remove:hover {
    color: var(--color-accent);
    background: var(--color-bg-alt);
}

/* Службовий рядок: купон + прихована кнопка оновлення */
.cart-table__actions-row td {
    padding: 20px 0 0;
    border: none;
}

/* Прихована кнопка update_cart: лише програмний триггер для js/cart.js
   (AJAX-оновлення кошика при зміні кількості), користувачам не потрібна.
   .screen-reader-text лишає її в потоці (1px) і "роздуває" через padding/
   border WC .button — display:none прибирає її з layout повністю. */
.cart-table__update.screen-reader-text {
    display: none !important;
}

/* Поле купона: інпут + outline-кнопка у стилі сайту (як "Перейти до оформлення") */
.cart-page__coupon {
    display: flex;
    align-items: stretch;
    gap: 10px;
    max-width: 420px;
    float: none;
    padding: 0;
}

.cart-page__coupon::before,
.cart-page__coupon::after {
    content: none !important;
    display: none !important;
}

.cart-page__coupon-input {
    flex: 1 1 auto;
    width: auto !important;
    height: 50px;
    padding: 0 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: #fff;
    font-family: var(--font-ui);
    font-size: 15px;
    color: var(--color-text);
    box-sizing: border-box;
}

.cart-page__coupon-input::placeholder {
    color: var(--color-muted);
}

.cart-page__coupon-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Специфічність вища за WC: .woocommerce :where(...) button.button {border:0;color:...} */
.cart-page__coupon-btn,
.woocommerce .cart-page__coupon-btn.button,
.woocommerce-page .cart-page__coupon-btn.button {
    flex: 0 0 auto;
    width: auto !important;
    float: none !important;
    height: 50px;
    padding: 0 24px;
    border: 1px solid var(--color-accent) !important;
    border-radius: var(--radius);
    background: transparent !important;
    color: var(--color-accent) !important;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.3s;
}

.cart-page__coupon-btn:hover,
.woocommerce .cart-page__coupon-btn.button:hover,
.woocommerce-page .cart-page__coupon-btn.button:hover {
    background: var(--color-accent) !important;
    color: #fff !important;
}


/* ── Бонусне списання TMEK BONUS (accordion) ────────────────────────────── */

.cart-bonus {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 20px;
}

.cart-bonus__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    box-sizing: border-box;
}

.cart-bonus__title {
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
    color: #111;
}

.cart-bonus .accordion__icon {
    width: 20px;
    height: 20px;
}

.cart-bonus__body {
    padding: 0 20px 20px;
}

.cart-bonus__info {
    font-size: 14px;
    line-height: 20px;
    color: #111;
    margin: 0 0 10px;
}

.cart-bonus__accent {
    color: #e00000;
}

.cart-bonus__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: 1px solid #e00000;
    border-radius: 5px;
    background: transparent;
    color: #111;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    transition: 0.25s;
    white-space: nowrap;
}

.cart-bonus__btn:hover {
    background: #e00000;
    color: #fff;
}

.cart-bonus__btn--apply {
    padding: 14px 24px;
}

.cart-bonus__btn--remove {
    border-color: #909090;
    color: #909090;
}

.cart-bonus__btn--remove:hover {
    background: #909090;
    border-color: #909090;
    color: #fff;
}

.cart-bonus__input-wrap {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 15px;
}

.cart-bonus__input {
    flex: 1 1 auto;
    max-width: 280px;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #eaeaea;
    border-radius: 5px;
    background: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    color: #111;
    box-sizing: border-box;
}

.cart-bonus__input:focus {
    outline: none;
    border-color: #e00000;
}

.cart-bonus__applied {
    font-size: 14px;
    line-height: 20px;
    color: #111;
    margin: 0 0 10px;
}

.cart-bonus__note {
    font-size: 14px;
    color: #909090;
    margin: 0;
}

.cart-bonus__message {
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
}

.cart-bonus__message.is-error {
    color: #b32d2e;
}

.cart-bonus__message.is-success {
    color: #1d7c34;
}

/* Рядок списання в підсумку */
.cart-page__subtotal--bonus {
    margin-top: 10px;
}

.cart-page__subtotal-value--bonus {
    color: #e00000;
    font-weight: 600;
}

.cart-page__subtotal--total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eaeaea;
}

.cart-page__subtotal--total .cart-page__subtotal-label {
    font-weight: 600;
}

.cart-page__subtotal--total .cart-page__subtotal-value {
    font-weight: 700;
}

/* ── Підсумок + кнопка оформлення ────────────────────────────────────────── */

.cart-page__totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 25px;
    margin-top: 30px;
}

.cart-page__subtotal {
    display: flex;
    align-items: baseline;
    gap: 40px;
}

.cart-page__subtotal-label {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
    color: var(--color-text);
}

.cart-page__subtotal-value,
.cart-page__subtotal-value .woocommerce-Price-amount {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
    color: var(--color-text);
    white-space: nowrap;
}

/* Кнопка "Перейти до оформлення" — стиль кнопки "Купити".
   Важкі селектори перебивають .woocommerce-page a.button.alt з WC CSS. */
.cart-page__checkout .checkout-button,
.woocommerce .cart-page__checkout a.checkout-button.button.alt,
.woocommerce-page .cart-page__checkout a.checkout-button.button.alt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    padding: 14px 30px;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    background: transparent;
    background-color: transparent;
    color: var(--color-accent);
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.3s;
    box-sizing: border-box;
}

.cart-page__checkout .checkout-button:hover,
.woocommerce .cart-page__checkout a.checkout-button.button.alt:hover,
.woocommerce-page .cart-page__checkout a.checkout-button.button.alt:hover {
    background: var(--color-accent);
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}


/* ── Порожній кошик ──────────────────────────────────────────────────────── */

.cart-page__card--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 60px 30px;
    text-align: center;
}

.cart-page__card--empty .cart-page__title {
    margin: 0;
}

.cart-page__empty-icon {
    display: block;
}

.cart-page__empty-text {
    font-size: 16px;
    line-height: 22px;
    color: var(--color-muted);
    margin: 0;
}

.cart-page__empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    padding: 14px 30px;
    margin-top: 10px;
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    color: var(--color-accent);
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;
    transition: 0.3s;
    box-sizing: border-box;
}

.cart-page__empty-btn:hover {
    background: var(--color-accent);
    color: #fff;
}


/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 1023px) {
    .cart-table__thumb {
        width: 140px;
    }

    .woocommerce-cart .cart-table .cart-table__thumb img,
    .cart-table__thumb img {
        width: 110px;
        height: 110px;
    }
}

/* Мобільний: таблиця → картки */
@media (max-width: 767px) {
    .cart-page {
        padding-block: 20px 60px;
    }

    .cart-page__title {
        font-size: 20px;
        line-height: 28px;
        margin-bottom: 20px;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table .cart_item {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding: 20px;
        border-bottom: 1px solid var(--color-border);
    }

    .cart-table .cart_item td {
        padding: 0 !important;
        border: none !important;
    }

    .cart-table__thumb {
        order: 1;
        flex: 1 1 100%;
        width: auto;
        text-align: center;
    }

    .woocommerce-cart .cart-table .cart-table__thumb img,
    .cart-table__thumb img {
        width: 160px;
        height: 160px;
        margin: 0 auto;
    }

    .cart-table__name {
        order: 2;
        flex: 1 1 100%;
        text-align: center;
        padding-right: 30px;
    }

    .cart-table__sku {
        order: 3;
        flex: 1 1 100%;
        text-align: center;
        font-size: 13px;
    }

    .cart-table__sku::before {
        content: 'Артикул: ';
    }

    .cart-table__qty {
        order: 4;
        flex: 0 1 auto;
        text-align: left;
    }

    .cart-table__qty .quantity {
        height: 40px;
    }

    .cart-table__price {
        order: 5;
        flex: 0 1 auto;
        margin-left: auto;
        text-align: right;
    }

    .cart-table__remove {
        position: absolute;
        top: 10px;
        right: 10px;
        width: auto;
    }

    .cart-table__actions-row {
        display: block;
    }

    .cart-table__actions-row td {
        padding-top: 15px;
    }

    .cart-page__coupon {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        max-width: none;
    }

    .cart-bonus__input {
        max-width: none;
        flex: 1 1 100%;
    }

    .cart-bonus__input-wrap {
        flex-wrap: wrap;
    }

    .cart-page__totals {
        align-items: stretch;
        gap: 20px;
        margin-top: 20px;
    }

    .cart-page__subtotal {
        justify-content: space-between;
        gap: 15px;
    }

    .cart-page__checkout .checkout-button,
    .woocommerce .cart-page__checkout a.checkout-button.button.alt,
    .woocommerce-page .cart-page__checkout a.checkout-button.button.alt {
        width: 100%;
    }
}
