/* ==========================================================================
   Cart page — The Mehfil
   Scoped to .mf-cartpage so nothing leaks into other templates.
   ========================================================================== */

.mf-cartpage {
    --mf-cart-surface: #121117;
    --mf-cart-line: rgba(245, 239, 230, 0.09);
    --mf-cart-line-soft: rgba(245, 239, 230, 0.06);
    padding-bottom: var(--mf-space-5xl, 6rem);
}

.mf-cartpage .mf-page-content {
    margin: 0;
}

/* ---------- Hero ---------- */
.mf-cart-hero {
    margin: 0 0 2.75rem;
}

.mf-cart-hero__title {
    font-family: var(--mf-font-display);
    font-size: clamp(2.6rem, 5.4vw, 4.1rem);
    line-height: 1.05;
    font-weight: 700;
    color: var(--mf-text-primary);
    margin: 0;
}

.mf-cart-hero__title span {
    color: var(--mf-red);
}

.mf-cart-hero__sub {
    margin: 0.9rem 0 0;
    font-size: 0.95rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--mf-text-secondary);
}

.mf-cart-hero__rule {
    display: block;
    width: 68px;
    height: 3px;
    margin-top: 1.15rem;
    background: var(--mf-red);
    border-radius: 2px;
}

/* ---------- Layout ---------- */
.mf-cart {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 2.25rem;
    align-items: start;
}

.mf-cart__main {
    min-width: 0;
}

.mf-cart__form {
    margin: 0;
}

/* ---------- Items card ---------- */
.mf-cart__table {
    background: var(--mf-cart-surface);
    border: 1px solid var(--mf-cart-line);
    border-radius: 14px;
    overflow: hidden;
}

.mf-cart__head,
.mf-cart__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7rem 10.5rem 7rem;
    align-items: center;
    gap: 1rem;
}

.mf-cart__head {
    padding: 1.15rem 1.6rem;
    border-bottom: 1px solid var(--mf-cart-line);
}

.mf-cart__h {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--mf-text-secondary);
}

.mf-cart__h--price,
.mf-cart__h--total {
    text-align: center;
}

.mf-cart__row {
    padding: 1.6rem;
    border-bottom: 1px solid var(--mf-cart-line-soft);
}

.mf-cart__row:last-of-type {
    border-bottom: 0;
}

/* Product cell */
.mf-cart__name {
    margin: 0;
    font-family: var(--mf-font-body);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--mf-text-primary);
}

.mf-cart__name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.mf-cart__name a:hover {
    color: var(--mf-gold);
}

.mf-cart__unit {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--mf-text-primary);
}

.mf-cart__desc {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--mf-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price + total cells */
.mf-cart__cell--price,
.mf-cart__cell--total {
    text-align: center;
    font-size: 1rem;
    color: var(--mf-text-primary);
}

.mf-cart__cell--total {
    font-weight: 700;
    font-size: 1.05rem;
}

.mf-cart__cell--price .woocommerce-Price-amount,
.mf-cart__cell--total .woocommerce-Price-amount {
    white-space: nowrap;
}

/* Quantity + remove */
.mf-cart__cell--qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
}

.mf-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--mf-red);
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
}

.mf-qty__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--mf-red);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    width: 2.1rem;
    height: 2.4rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.mf-qty__btn:hover:not(:disabled) {
    background: var(--mf-red);
    color: #fff;
}

.mf-qty__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* WooCommerce's quantity wrapper + input */
.mf-qty .quantity {
    margin: 0;
    float: none;
    display: block;
}

.mf-qty .quantity label,
.mf-qty .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.mf-cartpage .mf-qty input.qty {
    width: 2.6rem;
    min-width: 0;
    height: 2.4rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--mf-text-primary);
    font-family: var(--mf-font-body);
    font-size: 0.98rem;
    font-weight: 600;
    text-align: center;
    box-shadow: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.mf-cartpage .mf-qty input.qty:focus {
    outline: none;
}

.mf-cart__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: var(--mf-red);
    border-radius: 6px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.mf-cart__remove svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mf-cart__remove:hover {
    background: var(--mf-red-glow);
    color: var(--mf-red);
    transform: translateY(-1px);
}

/* Hidden update button (revealed by <noscript>) */
.mf-cart__update {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Pending quantity update */
.mf-cart__form.is-updating .mf-cart__table {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* ---------- Summary card ---------- */
.mf-cart__aside {
    position: sticky;
    top: calc(var(--mf-header-h, 170px) + 1.25rem);
}

.mf-sum {
    background: var(--mf-cart-surface);
    border: 1px solid rgba(196, 48, 48, 0.55);
    border-radius: 14px;
    padding: 1.9rem 1.75rem;
}

.mf-sum__title {
    margin: 0;
    font-family: var(--mf-font-display);
    font-size: 1.95rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--mf-text-primary);
}

.mf-sum__title span {
    color: var(--mf-red);
}

.mf-sum__rule {
    display: block;
    width: 52px;
    height: 3px;
    margin: 0.75rem 0 1.5rem;
    background: var(--mf-red);
    border-radius: 2px;
}

.mf-sum__rows {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.mf-sum__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.98rem;
}

.mf-sum__label {
    color: var(--mf-text-primary);
}

.mf-sum__value {
    color: var(--mf-text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.mf-sum__row--discount .mf-sum__value {
    color: var(--mf-gold);
}

.mf-sum__row--shipping {
    flex-direction: column;
    align-items: stretch;
}

.mf-sum__divider {
    height: 1px;
    margin: 1.35rem 0;
    background: var(--mf-cart-line);
}

.mf-sum__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mf-sum__total-label {
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--mf-text-primary);
}

.mf-sum__total-value {
    font-size: 1.32rem;
    font-weight: 700;
    color: var(--mf-red);
    white-space: nowrap;
}

.mf-sum__total-value .woocommerce-Price-amount {
    color: inherit;
}

.mf-sum__checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    padding: 1.05rem 1.25rem;
    background: var(--mf-red);
    color: #fff;
    border-radius: 8px;
    font-size: 1.02rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.18s ease;
}

.mf-sum__checkout:hover {
    background: #d93a3a;
    color: #fff;
    transform: translateY(-2px);
}

.mf-sum__checkout svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mf-sum__bag {
    width: 20px;
    height: 20px;
}

.mf-sum__arrow {
    width: 19px;
    height: 19px;
}

/* ---------- Closed / opening hours ---------- */
.mf-closed {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    background: rgba(196, 48, 48, 0.08);
    border: 1px solid rgba(196, 48, 48, 0.45);
    border-radius: 8px;
}

.mf-closed__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 1px;
    fill: none;
    stroke: var(--mf-red);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mf-closed__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.mf-closed__text strong {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--mf-text-primary);
}

.mf-closed__eta {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mf-gold);
}

.mf-closed__eta:empty {
    display: none;
}

.mf-closed__text em {
    font-size: 0.84rem;
    font-style: normal;
    color: var(--mf-text-secondary);
}

/* Disabled checkout button while closed */
.mf-hours.is-closed .mf-sum__checkout {
    background: var(--mf-bg-tertiary);
    color: var(--mf-text-muted);
    cursor: not-allowed;
    pointer-events: none;
}

.mf-hours.is-closed .mf-sum__checkout:hover {
    background: var(--mf-bg-tertiary);
    color: var(--mf-text-muted);
    transform: none;
}

.mf-hours.is-closed .mf-sum__arrow {
    display: none;
}

.mf-sum__secure {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    background: rgba(245, 239, 230, 0.035);
    border-radius: 8px;
}

.mf-sum__shield {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--mf-red);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mf-sum__secure-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mf-sum__secure-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mf-text-primary);
}

.mf-sum__secure-text em {
    font-size: 0.85rem;
    font-style: normal;
    color: var(--mf-text-secondary);
}

/* ---------- Empty cart ---------- */
.mf-cart-empty {
    text-align: center;
    padding: 3.5rem 1.5rem 4rem;
    background: var(--mf-cart-surface);
    border: 1px solid var(--mf-cart-line);
    border-radius: 14px;
}

.mf-cart-empty__icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 1.25rem;
    display: block;
    fill: none;
    stroke: var(--mf-red);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mf-cart-empty__title {
    margin: 0;
    font-family: var(--mf-font-display);
    font-size: 1.9rem;
    color: var(--mf-text-primary);
}

.mf-cart-empty__sub {
    margin: 0.75rem 0 1.75rem;
    color: var(--mf-text-secondary);
}

.mf-cart-empty__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 1.7rem;
    background: var(--mf-red);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.18s ease;
}

.mf-cart-empty__cta:hover {
    background: #d93a3a;
    color: #fff;
    transform: translateY(-2px);
}

.mf-cart-empty__cta svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- WooCommerce notices ---------- */
.mf-cartpage .woocommerce-notices-wrapper:empty {
    display: none;
}

.mf-cartpage .woocommerce-message,
.mf-cartpage .woocommerce-info,
.mf-cartpage .woocommerce-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--mf-cart-surface);
    border: 1px solid var(--mf-cart-line);
    border-left: 3px solid var(--mf-red);
    border-radius: 8px;
    color: var(--mf-text-primary);
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
    margin: 0 0 1rem;
    list-style: none;
}

.mf-cartpage .woocommerce-message::before,
.mf-cartpage .woocommerce-info::before,
.mf-cartpage .woocommerce-error::before {
    position: static;
    color: var(--mf-red);
    font-size: 1rem;
    line-height: 1;
}

.mf-cartpage .woocommerce-error {
    border-left-color: #e05252;
}

/* On the cart page this button links to the page you are already on. */
.mf-cartpage .woocommerce-message .button.wc-forward {
    display: none;
}

.mf-cartpage .woocommerce-notices-wrapper .button {
    background: var(--mf-red);
    color: #fff;
    border-radius: 6px;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.mf-cartpage .woocommerce-notices-wrapper .button:hover {
    background: #d93a3a;
    color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .mf-cart {
        grid-template-columns: 1fr;
    }

    .mf-cart__aside {
        position: static;
    }
}

@media (max-width: 860px) {
    .mf-cart__head {
        display: none;
    }

    .mf-cart__row {
        grid-template-columns: 1fr auto;
        gap: 0.75rem 1rem;
        padding: 1.35rem 1.15rem;
    }

    .mf-cart__cell--product {
        grid-column: 1 / -1;
    }

    .mf-cart__cell--price,
    .mf-cart__cell--total {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        text-align: left;
    }

    .mf-cart__cell--price::before,
    .mf-cart__cell--total::before {
        content: attr(data-mf-label) ":";
        font-size: 0.74rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--mf-text-secondary);
    }

    .mf-cart__cell--price {
        display: none;
    }

    .mf-cart__cell--qty {
        grid-column: 1;
        justify-content: flex-start;
    }

    .mf-cart__cell--total {
        grid-column: 2;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .mf-sum {
        padding: 1.5rem 1.25rem;
    }

    .mf-cart-hero__sub {
        font-size: 0.85rem;
        letter-spacing: 0.09em;
    }
}
