/* =========================================
   CHECKOUT / CART LAYOUT
========================================= */

.checkout-section {
    padding-block: clamp(2.5rem, 5vw, 4rem);
}

.checkout-headline {
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    text-align: center;
}

.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: clamp(1.25rem, 3vw, 2rem);
}

.cart-card {
    background: var(--brand-surface);
    border: 1px solid var(--brand-border-soft);
    border-radius: 24px;
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--brand-shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cart-card__header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cart-card__header h2,
.cart-card__header h3 {
    margin: 0;
}

.cart-card__header h3 {
    font-size: clamp(1.35rem, 2.4vw, 1.6rem);
    color: var(--brand-gray-900);
}

.cart-card__meta {
    font-size: 0.95rem;
    color: var(--brand-muted);
    line-height: 1.5;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    align-items: flex-start;
    gap: clamp(1rem, 2vw, 1.5rem);
    padding: 1rem 0;
    border-bottom: 1px solid var(--brand-border-soft);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item__details {
    flex: 1 1 55%;
}

.cart-item__details h3 {
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    margin-bottom: 0.3rem;
    color: var(--brand-gray-900);
}

.cart-item__meta {
    font-size: 0.95rem;
    color: var(--brand-muted);
    margin-bottom: 0.15rem;
}

.cart-item__controls {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cart-item__price-block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 140px;
}

.cart-item__price-label {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-muted);
    font-weight: 600;
}

.cart-item__price {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--brand-secondary);
}

.cart-item__qty {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cart-item__remove {
    border: 1px solid var(--brand-border-soft);
    background: var(--brand-surface);
    color: var(--brand-muted);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.cart-item__remove:hover,
.cart-item__remove:focus {
    background: var(--brand-danger-alpha-24);
    border-color: var(--brand-danger);
    color: var(--brand-danger);
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--brand-border-soft);
    border-radius: 999px;
    overflow: hidden;
    background: var(--brand-surface-soft);
}

.qty-control button {
    border: none;
    background: transparent;
    padding: 0.2rem 0.55rem;
    font-size: 1rem;
    cursor: pointer;
    color: var(--brand-secondary);
}

.qty-control input {
    width: 2.1rem;
    min-width: 2.1rem;
    border: none;
    text-align: center;
    font-weight: 600;
    background: transparent;
    font-size: 0.95rem;
    padding: 0.25rem 0;
}

.qty-control button:focus-visible {
    outline: 2px solid var(--brand-primary-alpha-24);
    outline-offset: 2px;
}

.cart-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-summary__box {
    border: 1px solid var(--brand-border-soft);
    border-radius: 18px;
    padding: 1rem 1.25rem;
    background: var(--brand-surface-soft);
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: var(--brand-secondary);
}

.cart-summary__total {
    font-size: 1.4rem;
    color: var(--brand-gray-900);
}

.cart-empty {
    text-align: center;
    padding: clamp(2rem, 5vw, 3rem);
}

.cart-empty img {
    max-width: 320px;
    margin: 1rem auto 0;
}

@media (max-width: 960px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .cart-item {
        flex-direction: column;
    }

    .cart-item__controls {
        width: 100%;
        justify-content: space-between;
    }

    .cart-item__price-block {
        width: 100%;
    }

    .cart-item__qty {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
    }
}

/* =========================================
   INLINE LOGIN & QTY CONTROL
========================================= */

.qty-input {
    color: var(--brand-black);
    background: var(--brand-surface);
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 100px;
    margin: auto;
    border-radius: 4px;
    box-shadow: 0 1em 2em -0.9em rgb(var(--brand-black-rgb) / 0.7);
    transform: scale(1);
}

.qty-input .product-qty,
.qty-input .qty-count {
    background: transparent;
    color: inherit;
    font-weight: bold;
    font-size: inherit;
    border: none;
    display: inline-block;
    min-width: 0;
    height: 2.5rem;
    line-height: 1;
    bottom: auto !important;
}

.qty-input .product-qty:focus,
.qty-input .qty-count:focus {
    outline: none;
}

.qty-input .product-qty {
    width: 50px;
    min-width: 0;
    display: inline-block;
    text-align: center;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.qty-input .qty-count {
    padding: 0;
    cursor: pointer;
    width: 2.5rem;
    font-size: 1.25em;
    text-indent: -100px;
    overflow: hidden;
    position: relative;
}

.qty-input .qty-count:before,
.qty-input .qty-count:after {
    content: "";
    height: 2px;
    width: 10px;
    position: absolute;
    display: block;
    background: var(--brand-black);
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

.qty-input .qty-count--minus {
    border-right: 1px solid var(--brand-border-neutral);
}

.qty-input .qty-count--add {
    border-left: 1px solid var(--brand-border-neutral);
}

.qty-input .qty-count--add:after {
    transform: rotate(90deg);
}

.qty-input .qty-count:disabled {
    color: var(--brand-border-neutral);
    background: var(--brand-gray-100);
    cursor: not-allowed;
    border-color: transparent;
}

.qty-input .qty-count:disabled:before,
.qty-input .qty-count:disabled:after {
    background: var(--brand-border-neutral);
}

.js-cart-form.has-inline-login .inline-form-fields {
    display: none;
}

.inline-form-email {
    margin-bottom: 1rem;
}

.cart-summary__box--login.has-inline-login .inline-summary-group {
    filter: blur(3px);
    pointer-events: none;
    opacity: 0.4;
}

.cart-summary__box--login .inline-login-only {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 0.5rem;
    border-top: 1px solid var(--brand-border-soft);
    padding-top: 0.5rem;
}

.cart-summary__box--login.has-inline-login .inline-login-only {
    display: flex;
}

.cart-summary__box--login.has-inline-login label {
    opacity: 0.7;
}
