/*
 * Galera — cart
 *
 * Items on the left as cards (a table cannot be made to fit a phone without
 * side scrolling), totals on the right and sticky.
 */

.woo-main { padding: 28px 0 64px; }

/* The .page section carries no padding of its own: without this the title
   sits on the header and the last panel on the footer. */
.woocommerce-cart .page { padding: 28px 0 56px; }

.woocommerce-cart .breadcrumbs { margin-bottom: 10px; }

.woocommerce-cart h1 { margin: 0 0 24px; }

.cart__items { min-width: 0; }

/* Totals below the list, aligned to the right edge of the page. */
.cart-collaterals {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
}

.cart-collaterals > * {
    width: 100%;
    max-width: 560px;
}

/* ── Items ──────────────────────────────────────────────────────────────── */
.cart-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-border);
}

.cart-item {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 20px;
    padding: 20px 44px 20px 0;
    border-bottom: 1px solid var(--color-border);
}

.cart-item__media img {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-alt);
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* Name, size and unit price read as one line instead of a stacked block. */
.cart-item__info {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 14px;
    min-width: 0;
}

.cart-item__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-navy);
}

.cart-item__title a:hover { color: var(--color-primary); }

.cart-item__meta {
    color: var(--color-muted);
    font-size: 14px;
}


/* WooCommerce wraps the variation data in dl > dt/dd, each a block; inline
   them so "Розмір: 40" stays on one line. */
.cart-item__meta,
.cart-item__meta dl,
.cart-item__meta dt,
.cart-item__meta dd,
.cart-item__meta p {
    display: inline;
    margin: 0;
}

.cart-item__meta dd + dt::before { content: ' · '; }

.cart-item__unit {
    margin: 0;
    color: var(--color-muted);
    font-size: 14px;
    white-space: nowrap;
}

.cart-item__unit-label { color: var(--color-muted); }

.cart-item__total {
    margin: 0;
    min-width: 96px;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--color-navy);
}

.cart-item__remove {
    position: absolute;
    top: 50%;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    border-radius: 50%;
    color: var(--color-muted);
    transition: background-color var(--transition), color var(--transition);
}

.cart-item__remove:hover {
    background: var(--color-bg-alt);
    color: var(--color-sale);
}

/* ── Actions row ────────────────────────────────────────────────────────── */
.cart__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0 0;
}

.cart__coupon {
    display: flex;
    flex: 1 1 320px;
    gap: 8px;
}

.cart__coupon .input-text {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 11px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #FFF;
    font-family: var(--font-body);
    font-size: 15px;
}

.cart__coupon .input-text:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

.cart__coupon .btn,
.cart__update { min-height: 44px; }

.cart__update[disabled] { opacity: .4; }

/* Shipping is chosen at checkout, not here. */
.cart_totals .woocommerce-shipping-totals { display: none; }

/* ── Totals ─────────────────────────────────────────────────────────────── */
.cart_totals {
    padding: 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg-alt);
}

.cart_totals h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

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

.cart_totals th,
.cart_totals td {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 15px;
    text-align: left;
    vertical-align: top;
}

.cart_totals th {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-muted);
}

.cart_totals td { text-align: right; }

.cart_totals .order-total th,
.cart_totals .order-total td {
    padding-top: 14px;
    border-bottom: 0;
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    color: var(--color-navy);
}

.cart_totals .woocommerce-shipping-methods {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.cart_totals .woocommerce-shipping-methods li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    margin-bottom: 2px;
}

/* A 13px native radio is hard to hit; the label carries the tap area. */
.cart_totals .woocommerce-shipping-methods input[type="radio"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-primary);
}

.cart_totals .woocommerce-shipping-methods label {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-height: 36px;
    cursor: pointer;
}

.cart_totals .woocommerce-shipping-methods label { font-size: 15px; }

.cart_totals .woocommerce-shipping-destination {
    margin: 8px 0 0;
    color: var(--color-muted);
    font-size: 14px;
    text-align: left;
}

.wc-proceed-to-checkout { margin-top: 20px; }

.wc-proceed-to-checkout .checkout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: #FFF;
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    transition: background-color var(--transition);
}

.wc-proceed-to-checkout .checkout-button:hover { background: var(--color-primary-dark); }

/* ── Empty ──────────────────────────────────────────────────────────────── */
.cart-empty {
    max-width: 620px;
    margin: 0 auto;
    padding: 40px 0 56px;
    text-align: center;
}

.cart-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.cart-empty__title { margin: 0 0 10px; }

.cart-empty__text {
    margin: 0;
    color: var(--color-muted);
}

.cart-empty__cats { justify-content: center; margin-top: 24px; }

.cart-empty__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.cart-empty__actions .btn { gap: 10px; }

/* ── Cross-sells ────────────────────────────────────────────────────────── */
.cross-sells { margin-top: 48px; }

.cross-sells > h2 {
    margin: 0 0 20px;
    font-size: 24px;
}

/* ── Adaptive ───────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .cart-collaterals { margin-top: 28px; }
    .cart-collaterals > * { max-width: none; }
}

@media (max-width: 767px) {
    .woo-main { padding: 20px 0 44px; }

    /* Photo spans both rows; the name sits on top, quantity and sum share the
       line below it instead of stacking into two more rows. */
    .cart-item {
        grid-template-columns: 84px minmax(0, 1fr) auto;
        gap: 12px 14px;
        padding: 18px 40px 18px 0;
    }

    .cart-item__media { grid-row: 1 / span 2; align-self: start; }
    .cart-item__media img { width: 84px; height: 84px; }

    .cart-item__info  { grid-column: 2 / -1; }
    .cart-item__qty   { grid-column: 2; justify-self: start; }

    .cart-item__total {
        grid-column: 3;
        justify-self: end;
        align-self: center;
        min-width: 0;
        text-align: right;
    }

    .cart__actions { flex-direction: column; align-items: stretch; }
    .cart__coupon  { flex: 0 1 auto; }
    .cart__update  { width: 100%; }

    .cart-empty__actions .btn { width: 100%; }
}

@media (max-width: 479px) {
    /* "Перейти до оформлення" wrapped onto two lines at 360px. */
    .wc-proceed-to-checkout .checkout-button {
        padding: 14px 18px;
        font-size: 16px;
    }

    .cart-item__total { font-size: 17px; }
    .cart_totals      { padding: 20px 18px; }
}

/* ── Quantity in the cart ───────────────────────────────────────────────── */
.cart-item .quantity {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.cart-item .quantity__button {
    width: 38px;
    height: 44px;
    border: 0;
    background: none;
    color: var(--color-navy);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition);
}

.cart-item .quantity__button:hover { background: var(--color-primary-soft); }

.cart-item .quantity input.qty {
    width: 40px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
}

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

/* A heading, not a link in running text — main.css underlines those, and its
   "p a:not([class])" outweighs a plain class selector. */
.cart-item__title a:not([class]) {
    color: var(--color-navy);
    text-decoration: none;
}

.cart-item__title a:not([class]):hover { color: var(--color-primary); }
