/**
 * Cart Page Base CSS
 * Shared resets and layout primitives used by all cart-page style variants.
 *
 * @package WooLentor Pro
 */

.wl-shipping-calculator .shipping-calculator-button {
    display: none;
}

/* ── Shared wrapper ─────────────────────────────────────────────────────── */
.wl-cart-page-wrap {
    position: relative;
    width: 100%;
}

/* ── Cart table shared ──────────────────────────────────────────────────── */
.wl-cart-table-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.wl-cart-item {
    position: relative;
    width: 100%;
}

.wl-cart-item__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wl-cart-item__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wl-cart-item__controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Quantity stepper reset — styles live in each variant CSS */
.wl-qty-stepper {
    display: inline-flex;
    align-items: center;
}

.wl-qty-stepper input[type="number"] {
    -moz-appearance: textfield;
    text-align: center;
}

.wl-qty-stepper input[type="number"]::-webkit-outer-spin-button,
.wl-qty-stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wl-qty-stepper button {
    cursor: pointer;
    line-height: 1;
}

.wl-cart-item__price {
    display: flex;
    flex-direction: column;
}

/* ── Cart total shared ──────────────────────────────────────────────────── */
.wl-cart-total-wrap {
    width: 100%;
}

.wl-cart-total-card {
    width: 100%;
}

.wl-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.wl-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.wl-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    cursor: pointer;
    text-decoration: none;
}

/* ── Cart cross sells shared ────────────────────────────────────────────── */
.wl-cross-sells-wrap {
    width: 100%;
}

.wl-cross-sells-grid {
    display: grid;
}

.wl-cross-sell-card {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.wl-cross-sell-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Cart empty shared ──────────────────────────────────────────────────── */
.wl-cart-empty-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.wl-cart-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

/* ── Shipping options shared ────────────────────────────────────────────── */
.wl-ship-opts {
    display: flex;
    flex-direction: column;
}

.wl-ship-opt {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.wl-ship-opt input[type="radio"] {
    display: none;
}

/* ── Trust signals shared ───────────────────────────────────────────────── */
.wl-trust-signals {
    display: grid;
}

.wl-trust-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ── AJAX loading state ─────────────────────────────────────────────────── */
@keyframes wl-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Applied to .wl-cart-total-wrap while a shipping/coupon AJAX call is in flight */
.wl-cart-total-wrap.wl-updating {
    pointer-events: none;
}

/* Semi-transparent overlay that sits above the card content */
.wl-cart-total-wrap.wl-updating::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
    z-index: 11;
    border-radius: inherit;
}

/* Spinner ring — centered via negative margin so transform is rotation-only */
.wl-cart-total-wrap.wl-updating::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    margin-left: -14px;
    border-radius: 50%;
    border: 2.5px solid rgba(0, 0, 0, 0.1);
    border-top-color: rgba(0, 0, 0, 0.55);
    animation: wl-spin 0.65s linear infinite;
    z-index: 12;
}

/* ── WooCommerce form override — prevent default styles from bleeding in ─ */
.wl-cart-table-wrap form,
.wl-cart-total-wrap form {
    margin: 0;
    padding: 0;
}

/* ── Accessibility ─────────────────────────────────────────────────────── */
.wl-cart-item__remove:focus-visible,
.wl-qty-stepper button:focus-visible,
.wl-checkout-btn:focus-visible,
.wl-cart-empty-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    .wl-cart-table-wrap *,
    .wl-cart-total-wrap *,
    .wl-cross-sells-wrap *,
    .wl-cart-empty-wrap * {
        animation: none !important;
        transition: none !important;
    }
}