/* ==========================================================================
   Cart Page — Anghang Pinoy
   ========================================================================== */

/* ── Page wrapper ──────────────────────────────────────────────────────────── */
.ap-cart {
    background: var(--color-bg);
    padding-block: 48px 80px;
}

/* ── Breadcrumb ────────────────────────────────────────────────────────────── */
.ap-cart__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-muted);
    margin-bottom: 24px;
}
.ap-cart__breadcrumb a {
    color: var(--color-muted);
    text-decoration: none;
}
.ap-cart__breadcrumb a:hover { color: var(--color-primary); }
.ap-cart__breadcrumb span:last-child {
    color: var(--color-dark);
    font-weight: 700;
}
.ap-cart__breadcrumb-sep { color: var(--color-muted); }

/* ── Heading ───────────────────────────────────────────────────────────────── */
.ap-cart__heading {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--color-dark);
    margin: 0 0 32px;
    line-height: 1.2;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.ap-cart__empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 48px 0;
}
.ap-cart__empty p {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--color-muted);
    margin: 0;
}

/* ── 2-column layout ───────────────────────────────────────────────────────── */
.ap-cart__layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}
.ap-cart__items {
    flex: 1 1 0;
    min-width: 0;
}
.ap-cart__summary {
    width: 405px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
}

/* ── Column headers (desktop) ──────────────────────────────────────────────── */
.ap-cart__headers {
    display: grid;
    grid-template-columns: 1fr 127px 127px 127px;
    gap: 16px;
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
}
.ap-cart__headers span {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 14px;
    color: var(--color-muted);
    text-align: center;
}
.ap-cart__headers span:first-child { text-align: left; }

/* ── Item row ──────────────────────────────────────────────────────────────── */
.ap-cart__row {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 127px 127px 127px;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    min-height: 114px;
}

/* ── Product cell ──────────────────────────────────────────────────────────── */
.ap-cart__product {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ap-cart__image-wrap {
    flex-shrink: 0;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
}
.ap-cart__image-wrap img,
.ap-cart__image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
}
.ap-cart__product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ap-cart__product-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-dark);
    text-decoration: none;
    line-height: 1.4;
}
.ap-cart__product-name:hover { color: var(--color-primary); }
.ap-cart__product-variant {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--color-muted);
}
.ap-cart__remove--mobile { display: none; }

/* ── Price cell ────────────────────────────────────────────────────────────── */
.ap-cart__price {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 16px;
    color: var(--color-dark);
    text-align: center;
}
.ap-cart__price .woocommerce-Price-amount { color: var(--color-dark); }

/* ── Qty stepper ───────────────────────────────────────────────────────────── */
.ap-cart__qty-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}
.ap-cart__qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    width: 98px;
    height: 34px;
    overflow: hidden;
    background: #fff;
}
.ap-cart__qty-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
}
.ap-cart__qty-btn:hover { color: var(--color-primary); }
.ap-cart__qty-input {
    width: 34px;
    text-align: center;
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-top: none;
    border-bottom: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-dark);
    background: none;
    padding: 0;
    height: 32px;
    -moz-appearance: textfield;
}
.ap-cart__qty-input::-webkit-outer-spin-button,
.ap-cart__qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ap-cart__qty-input:focus { outline: none; }

/* ── Subtotal cell ─────────────────────────────────────────────────────────── */
.ap-cart__subtotal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.ap-cart__subtotal-amount {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    color: var(--color-primary);
}
.ap-cart__subtotal-amount .woocommerce-Price-amount { color: var(--color-primary); }

/* ── Remove button (desktop) ───────────────────────────────────────────────── */
.ap-cart__remove--desktop {
    color: var(--color-muted);
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.15s;
}
.ap-cart__remove--desktop:hover { color: var(--color-primary); }

/* ── Continue Shopping link ────────────────────────────────────────────────── */
.ap-cart__continue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 14px;
    color: var(--color-primary);
    text-decoration: none;
    margin-top: 8px;
    transition: opacity 0.15s;
}
.ap-cart__continue:hover { opacity: 0.8; }

/* ── Order Summary card ────────────────────────────────────────────────────── */
.ap-cart__totals {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ap-cart__totals-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
    color: var(--color-dark);
    margin: 0 0 4px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

/* ── Coupon form ───────────────────────────────────────────────────────────── */
.ap-cart__coupon {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.ap-cart__coupon-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    gap: 8px;
}
.ap-cart__coupon-icon {
    color: var(--color-muted);
    flex-shrink: 0;
}
.ap-cart__coupon-input {
    flex: 1;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-dark);
    padding: 10px 0;
    height: 40px;
}
.ap-cart__coupon-input::placeholder { color: var(--color-muted); }
.ap-cart__coupon-input:focus { outline: none; }
.ap-cart__coupon-btn {
    padding: 0 16px;
    height: 40px;
    background: none;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.ap-cart__coupon-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ── Totals rows ───────────────────────────────────────────────────────────── */
.ap-cart__totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ap-cart__totals-label {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-muted);
}
.ap-cart__totals-value {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;
    color: var(--color-dark);
}
.ap-cart__totals-muted {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-muted);
    font-style: italic;
}
.ap-cart__totals-row--coupon .woocommerce-remove-coupon {
    font-size: 12px;
    color: var(--color-muted);
}

/* ── Divider ───────────────────────────────────────────────────────────────── */
.ap-cart__totals-divider {
    border-top: 1px solid var(--color-border);
    margin: 0;
}

/* ── Total row ─────────────────────────────────────────────────────────────── */
.ap-cart__totals-row--total {
    padding-top: 4px;
}
.ap-cart__totals-total-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    color: var(--color-dark);
}
.ap-cart__totals-total-amount {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    color: var(--color-primary);
}
.ap-cart__totals-total-amount .woocommerce-Price-amount { color: var(--color-primary); }

/* ── Checkout button ───────────────────────────────────────────────────────── */
.ap-cart__checkout-btn {
    display: block;
    background: var(--color-primary);
    color: #fff;
    text-align: center;
    padding: 0;
    height: 60px;
    line-height: 60px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    transition: background 0.15s;
}
.ap-cart__checkout-btn:hover {
    background: var(--color-primary-dark, #a01e23);
    color: #fff;
}

/* ── Payment badges ────────────────────────────────────────────────────────── */
.ap-cart__payment-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.ap-cart__payment-badge {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 4px 10px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-muted);
    letter-spacing: 0.03em;
}

/* ==========================================================================
   Mobile — ≤ 768px
   ========================================================================== */
@media (max-width: 768px) {

    .ap-cart__heading {
        font-size: 24px;
        margin-bottom: 24px;
    }

    /* Switch to single-column */
    .ap-cart__layout {
        flex-direction: column;
    }
    .ap-cart__summary {
        width: 100%;
        position: static;
    }

    /* Hide column headers */
    .ap-cart__headers {
        display: none;
    }

    /* Item card becomes a vertical stack */
    .ap-cart__row {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: unset;
    }

    /* Product row stays flex-row on mobile */
    .ap-cart__product {
        align-items: flex-start;
    }

    /* Show mobile remove, hide desktop X */
    .ap-cart__remove--mobile {
        display: inline-block;
        font-family: var(--font-body);
        font-size: 12px;
        color: var(--color-muted);
        text-decoration: underline;
        margin-top: 4px;
    }
    .ap-cart__remove--desktop { display: none; }

    /* Price: show "Price:" label prefix via data-label attribute */
    .ap-cart__price {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .ap-cart__price::before {
        content: attr(data-label);
        font-family: var(--font-body);
        font-size: 13px;
        color: var(--color-muted);
        font-weight: 400;
    }

    /* Qty stepper — left-aligned on mobile */
    .ap-cart__qty-wrap {
        justify-content: flex-start;
    }

    /* Subtotal row — space-between on mobile (amount + nothing, or with remove) */
    .ap-cart__subtotal {
        justify-content: space-between;
    }

    /* Coupon form stacks on very narrow screens */
    .ap-cart__coupon {
        flex-wrap: wrap;
    }
    .ap-cart__coupon-input-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }

}
