/* ==========================================================================
   NF Cart Page — cart.css
   Loaded only on is_cart() pages.
   ========================================================================== */

/* ── Wrapper ────────────────────────────────────────────────────────────────── */
.nf-cart-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
    font-family: inherit;
}

/* ── Free shipping bar ───────────────────────────────────────────────────────── */
.nf-cart-free-shipping {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}


.nf-cart-free-shipping.nf-achieved .nf-cart-free-shipping__text {
    color: #000;
    font-weight: 700;
}

.nf-cart-free-shipping__icon {
    flex-shrink: 0;
}

.nf-cart-free-shipping__icon img {
    display: block;
}

.nf-cart-free-shipping__text {
    flex: 1;
    font-size: 14px;
    color: #333;
    min-width: 160px;
}

.nf-cart-free-shipping__bar {
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.nf-cart-free-shipping__fill {
    height: 100%;
    background: #2b9640;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ── Trust badges ────────────────────────────────────────────────────────────── */
.nf-cart-trust-badges {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 0px 0px 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.nf-cart-trust-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 180px;
    max-width: 280px;
}

.nf-cart-trust-badge img,
.nf-cart-trust-badge__icon {
    flex-shrink: 0;
    opacity: 0.9;
}

.nf-cart-trust-badge span {
    font-size: 12px;
    color: #000;
    line-height: 1.4;
    font-weight: 300;
}

/* ── Main 2-column layout ───────────────────────────────────────────────────── */
.nf-cart-main {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 8px;
    align-items: start;
}

/* ── Cart items column ──────────────────────────────────────────────────────── */
.nf-cart-items-col {
    background-color: #F6F6F6;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #DFDFDF;
}

.nf-cart-items-heading {
    font-size: 20px !important;
    font-weight: 500 !important;
    color: #000 !important;
    margin: 0 !important;
}

.nf-cart-table span {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    text-transform: capitalize;
}

/* Table header */
.nf-cart-table__head {
    display: grid;
    grid-template-columns: 1fr 140px 120px;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 2px solid #eee;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nf-cart-col-qty,
.nf-cart-col-price {
    text-align: center;
}

.nf-cart-col-price {
    text-align: right;
}

/* Cart rows */
.nf-cart-row {
    display: grid;
    grid-template-columns: 1fr 140px 120px;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

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

.nf-cart-row__product {
    display: flex;
    gap: 14px;
    align-items: center;
}

.nf-cart-row__image {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}

tr.nf-cart-totals__total.order-total th {
    align-content: flex-start !important;
}

.nf-cart-row__image img,
.nf-cart-row__image a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nf-cart-row__info {
    flex: 1;
    min-width: 0;
    margin-top: 15px;
}

.nf-cart-row__name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    margin-bottom: 4px;
}

.nf-cart-row__name a {
    color: inherit;
    text-decoration: none;
}

.nf-cart-row__name a:hover {
    text-decoration: underline;
}

/* Quantity controls */
.nf-cart-row__qty {
    display: flex;
    justify-content: center;
}

.nf-cart-row__qty .quantity {
    display: flex;
    align-items: center;
    border: none !important;
    border-radius: 6px;
    overflow: visible;
}

.nf-qty-btn {
    background: none;
    border: none;
    width: 32px;
    height: 36px;
    cursor: pointer;
    font-size: 14px;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
    flex-shrink: 0;
    font-weight: 300;
}
.nf-qty-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.nf-qty-btn:hover {
    color: #000 !important;
    background-color: transparent !important;
}

.nf-qty-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.nf-qty-input {
    width: 30px !important;
    padding: 0 !important;
    margin: 0;
    text-align: center;
    height: 36px;
    font-size: 14px;
    font-weight: 300;
    color: #000 !important;
    background: transparent;
    -moz-appearance: textfield;
    border: none !important;
}

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

.nf-qty-input:focus {
    outline: none;
}

/* Line price */
.nf-cart-row__price {
    text-align: right;
    font-size: 15px;
    font-weight: 700;
    color: #000;
}

.nf-cart-row__price span {
    font-weight: 300;
    font-size: 14px !important;
}

.nf-price-wrapper.nf-has-discount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.nf-original-price {
    font-weight: 400;
    color: #999;
    font-size: 13px;
    text-decoration: line-through;
}

.nf-discounted-price {
    color: #c0392b;
    font-weight: 700;
    text-decoration: none;
    font-style: normal;
}

/* ── Order summary column ───────────────────────────────────────────────────── */
.nf-cart-order-summary {
    background: #F6F6F6;
    border: 1px solid #DFDFDF;
    border-radius: 5px;
    padding: 24px;
}

.nf-cart-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.nf-cart-summary-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #000;
}

/* Content wrapper */
.nf-order-summary-content {
    overflow: hidden;
}

.nf-cart-summary-total {
    font-size: 17px;
    font-weight: 700;
    color: #222;
}

small.includes_tax {
    font-weight: 300 !important;
}

.nf-cart-coupon-form-wrapper {
    display: block;
}

.nf-cart-coupon-input-row {
    margin-bottom: 8px;
}

.nf-cart-coupon-input-row {
    display: flex;
    gap: 8px;
}

.nf-cart-coupon-input {
    flex: 1;
    border: 1px solid #8B8B8B !important;
    border-radius: 6px !important;
    padding: 10px 12px !important;
    font-size: 14px;
    color: #333;
    background: #fafafa;
}

.nf-cart-coupon-input:focus {
    outline: none;
    border-color: #2b9640;
    background: #fff;
}

.nf-cart-apply-coupon {
    padding: 10px 18px;
    background: #fff;
    border: 1px solid #8B8B8B;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 300;
    cursor: pointer !important;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    color: #000;
}

button.nf-cart-apply-coupon:hover,
button.nf-cart-apply-coupon:focus{
    background-color: #50ab5a;
}

a.nf-cart-remove-coupon {
    text-decoration: none;
}

.nf-cart-apply-coupon:hover {
    background: #333;
    color: #fff;
}

.nf-cart-coupon-message {
    font-size: 13px;
    min-height: 18px;
}

.nf-cart-coupon-message.is-error {
    color: #c0392b;
}

.nf-cart-coupon-message.is-success {
    color: #2b9640;
}

.nf-cart-applied-coupons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.nf-cart-coupon-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eafbee;
    border: 1px solid #2b9640;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 13px;
    color: #1e7a2d;
    font-weight: 600;
}

.nf-cart-remove-coupon {
    color: #666;
    font-size: 16px;
    text-decoration: none;
    line-height: 1;
}

.nf-cart-remove-coupon:hover {
    color: #c0392b;
}

/* Totals table */
.nf-cart-totals {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

.nf-cart-totals tr {
    border: none;
}

.nf-cart-totals th,
.nf-cart-totals td {
    padding: 10px 0;
    color: #444;
    vertical-align: middle;
}

.nf-cart-totals th {
    font-weight: 300;
    text-align: left;
}

.nf-cart-totals td {
    text-align: right;
    font-weight: 600;
}

.nf-cart-totals__total th,
.nf-cart-totals__total td {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    padding-top: 14px;
    border-top: 1px solid #DFDFDF;
}

.nf-cart-totals__tax-note td {
    font-size: 12px;
    color: #888;
    font-weight: 400;
    text-align: left;
    padding-top: 0;
}

.nf-shipping-placeholder {
    color: #999;
    font-style: italic;
    font-weight: 400;
    font-size: 13px;
}

.nf-free-shipping-label {
    color: #2b9640;
    font-weight: 700;
}

/* Coupon discount row */
.nf-cart-totals__coupon td .woocommerce-remove-coupon {
    font-size: 12px;
    color: #999;
    margin-left: 6px;
    text-decoration: none;
}

.nf-cart-totals__coupon td .woocommerce-remove-coupon:hover {
    color: #c0392b;
}

/* CTA button */
body .nf-cart-summary-col a.nf-cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: #35AC5A;
    color: #fff !important;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    margin-bottom: 12px;
    text-align: center;
}

.nf-cart-checkout-btn:hover {
    background: #236f32;
    color: #fff;
    transform: translateY(-1px);
}

.nf-cart-continue-shopping {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    color: #000;
    text-decoration: none !important;
    font-weight: 300;
    transition: color 0.2s;
}

.nf-cart-continue-shopping:hover {
    color: #333;
}

tr.nf-cart-totals__subtotal span.amount {
    font-size: 14px !important;
    color: #000;
    font-weight: 500;
}

/* ── Upsells section ─────────────────────────────────────────────────────────── */
.nf-cart-offers-section {
    margin-top: 56px;
}

.nf-cart-offers-title {
    font-size: 30px !important;
    text-align: center;
    margin: 0 0 28px;
}

/* Override sidecart container styles (from side-cart.css) */
.nf-cart-offers-section .nf-sidecart-offers-section {
    background: transparent;
    border-top: none;
    margin-top: 0;
    padding-top: 0;
    flex-shrink: unset;
}

/* Hide the "Limited offer" header + countdown timer */
.nf-cart-offers-section .nf-offers-header {
    display: none;
}

/* Override sidecart upsell layout for grid on cart page */
.nf-cart-offers-section .nf-sidecart-upsells {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.nf-cart-offers-section .nf-upsell-card--sidecart {
    border: 1px solid #33AB59;
    border-radius: 5px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: transparent;
    transition: box-shadow 0.2s;
    position: relative;
    padding-bottom: 5px !important;
}

.nf-cart-offers-section .nf-upsell-card--sidecart:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .nf-cart-main {
        grid-template-columns: 1fr;
    }

    .nf-cart-order-summary {
        position: static;
    }
}

@media (max-width: 850px) {
    .nf-cart-trust-badges {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding-bottom: 0;
        justify-content: flex-start;
    }

    .nf-cart-trust-badges::-webkit-scrollbar {
        display: none;
    }

    .nf-cart-trust-badge {
        flex: 0 0 100%;
        scroll-snap-align: start;
        min-width: 0;
        max-width: none;
        justify-content: center;
        padding: 0 16px;
        text-align: center;
    }

    .nf-cart-table__head {
        display: none;
    }

    /* Cart row: side-cart style — [img+name / price] | [qty] */
    .nf-cart-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        column-gap: 8px;
        row-gap: 6px;
    }

    .nf-cart-row__product {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
    }

    .nf-cart-row__qty {
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        justify-content: flex-end;
        padding-left: 0;
    }

    .nf-cart-row__qty .quantity {
        overflow: visible;
    }

    .nf-cart-row__qty .nf-qty-btn {
        width: 24px;
        height: 30px;
        font-size: 14px;
    }

    .nf-cart-row__qty .nf-qty-input {
        width: 40px !important;
        height: 30px;
        padding: 0;
        font-size: 14px;
        font-weight: 500;
    }

    .nf-cart-row__price {
        grid-column: 2;
        grid-row: 1;
        text-align: right;
        align-self: end;
        padding-left: 0;
        font-weight: 500;
        font-size: 14px;
    }

    .nf-cart-offers-section .nf-sidecart-upsells {
        grid-template-columns: 1fr;
        padding: 0 !important;
    }

    .nf-cart-offers-section .nf-upsell-card--sidecart {
        padding: 16px 0px !important;
    }
}

@media (max-width: 480px) {
    .nf-cart-row__image {
        width: 56px;
        height: 56px;
    }

    .nf-cart-page {
        padding: 0 12px 40px;
    }
}

/* ── Loading state overlay ───────────────────────────────────────────────────── */
.nf-cart-page.nf-cart-updating {
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}


table.nf-cart-totals tbody tr th, table.nf-cart-totals tbody tr td {
    border: none !important;
    background: transparent;
}

/* ── Upsell card styles (copied from side-cart.css, scoped to cart page) ───── */
/* These replace the dependency on side-cart.css which is now excluded on is_cart() */

.nf-cart-offers-section .nf-sidecart-upsells {
    padding: 0 12px 4px;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 0;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-card {
    background: transparent;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    overflow: hidden;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-body {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 18px;
    row-gap: 4px;
    padding: 8px;
    position: relative;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-media {
    grid-row: 1 / span 1;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-discount-badge {
    position: absolute;
    top: 10px;
    left: calc(8px + 55px - 17.5px); /* = 60.5px: centers badge on media right edge */
    right: auto;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #de1528;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-text {
    min-width: 0;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-title {
    margin: 0 0 2px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 500;
    color: #000;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-description {
    margin: 0 0 2px;
    font-size: 14px;
    line-height: 1.4;
    color: #000;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 300;
    font-family: "Fira Sans", sans-serif;
    line-height: 18px;
}
.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-price {
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    color: #111827;
    padding-top: 5px;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-actions {
    align-self: end;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-add.nf-icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    min-width: 0;
    border-radius: 9999px;
    border: none;
    background: transparent;
    color: transparent;
    text-transform: none;
    box-shadow: none;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-add.nf-icon-btn:hover {
    background: transparent;
    border: none;
    opacity: 0.8;
}

.nf-cart-offers-section .nf-sidecart-upsells .nf-upsell-add.nf-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nf-cart-offers-section .nf-icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.nf-cart-offers-section .nf-icon-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

del.nf-upsell-price__regular {
    font-size: 14px;
    font-weight: 300;
}

ins.nf-upsell-price__sale {
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.nf-cart-row__qty .quantity button:focus {
    background-color: transparent !important;
    color: #000;
}

tr.nf-cart-totals__total.order-total {
    border-top: 1px solid #DFDFDF;
}

tr.nf-cart-totals__shipping * {
    padding-top: 0;
}

h1.entry-title {
    display: none !important;
}

@media (max-width: 850px){
    .nf-cart-coupon-message {
        min-height: unset !important;
    }

    .nf-cart-offers-section {
        margin-top: 26px;
    }

    .nf-cart-row__product {
        align-items: start;
    }

    .nf-cart-row__info {
        margin-top: 2px !important;
    }
}