/**
 * Made to Fit Shopping Cart Styles
 *
 * Modulære CSS styles til shopping cart shortcodes
 * Designet til brug med Avada Child Theme
 *
 * @version 3.1.1
 * @author Made to Fit
 *
 * Shortcode support:
 * - [mtf_cart] - Komplet indkøbskurv
 * - [mtf_cart_items] - Vare-liste
 * - [mtf_cart_summary] - Ordre oversigt
 * - [mtf_cart_actions] - Handlings-knapper
 * - [mtf_cart_promo] - Rabatkoder/gavekort
 * - [mtf_cart_clear] - Ryd kurv funktionalitet
 */

/* =================================================================== */
/* FONTS & VARIABLES                                                  */
/* =================================================================== */

/* Import Plus Jakarta Sans font for consistent typography */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* CSS Custom Properties - Design system farver og værdier */
:root {
    --mtf-primary: #061c1c;
    --mtf-gray-bg: #f8f8f8;
    --mtf-text-primary: #1a1a1a;
    --mtf-text-secondary: #666666;
    --mtf-text-light: #999999;
    --mtf-border: #e5e5e5;
    --mtf-white: #ffffff;
    --mtf-discount-red: #e74c3c;
    --mtf-success: #27ae60;
}

/* =================================================================== */
/* BASE LAYOUT & CONTAINERS                                           */
/* =================================================================== */

/* Hovedcontainer for alle cart shortcodes */
.mtf-cart-wrapper {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--mtf-text-primary);
    background: var(--mtf-white);
}

.mtf-cart-wrapper * {
    box-sizing: border-box;
}

.mtf-cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* =================================================================== */
/* CART HEADER & NAVIGATION                                           */
/* =================================================================== */
.mtf-cart-header {
    margin-bottom: 25px;
}

.mtf-back-link {
    color: var(--mtf-text-primary);
    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
    transition: opacity 0.3s;
}

.mtf-back-link:hover {
    opacity: 0.7;
}

.mtf-cart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.mtf-cart-header-count {
    font-size: 13px;
    color: var(--mtf-text-secondary);
}

.mtf-clear-cart-btn {
    background: none;
    border: none;
    color: var(--mtf-text-light);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-decoration: underline;
}

.mtf-clear-cart-btn:hover {
    color: var(--mtf-discount-red);
    background: rgba(231, 76, 60, 0.1);
    text-decoration: none;
}

/* =================================================================== */
/* EMPTY CART STATE - ENHANCED DESIGN                                */
/* =================================================================== */

/* Base empty cart container */
.mtf-empty-cart {
    text-align: center;
    padding: 60px 30px;
    background: var(--mtf-gray-bg);
    border-radius: 16px;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    max-width: 600px;
}

/* Container for centered content */
.mtf-empty-cart-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Style variations */
.mtf-empty-cart-madetofit {
    background: var(--mtf-white) !important;
    border: 1px solid var(--mtf-border);
    box-shadow: 0 4px 20px rgba(6, 28, 28, 0.08);
}

/* Force white background on all empty cart containers */
.mtf-empty-cart {
    background: var(--mtf-white) !important;
}

.mtf-empty-cart-minimal {
    background: #ffffff;
    border: 2px dashed #e9ecef;
    padding: 40px 20px;
    min-height: 300px;
}

.mtf-empty-cart-minimal::before {
    display: none;
}

.mtf-empty-cart-classic {
    background: var(--mtf-gray-bg);
    border: 1px solid var(--mtf-border);
}

/* Lottie Animation styling */
.mtf-empty-cart-animation {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.mtf-empty-cart-animation lottie-player,
.mtf-empty-cart-animation dotlottie-player {
    max-width: 200px;
    max-height: 200px;
    transition: all 0.3s ease;
    opacity: 0.9;
    pointer-events: none;
    user-select: none;
}

/* Skjul ALLE Lottie player controls */
.mtf-empty-cart-animation lottie-player .controls,
.mtf-empty-cart-animation lottie-player .toolbar,
.mtf-empty-cart-animation lottie-player .progress,
.mtf-empty-cart-animation lottie-player .play-button,
.mtf-empty-cart-animation lottie-player .pause-button,
.mtf-empty-cart-animation lottie-player .stop-button,
.mtf-empty-cart-animation lottie-player .loop-button,
.mtf-empty-cart-animation lottie-player .progress-bar,
.mtf-empty-cart-animation lottie-player .seeker,
.mtf-empty-cart-animation lottie-player .control-bar,
.mtf-empty-cart-animation lottie-player [class*="control"],
.mtf-empty-cart-animation lottie-player [class*="button"],
.mtf-empty-cart-animation lottie-player [class*="progress"],
.mtf-empty-cart-animation lottie-player [class*="toolbar"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* Skjul shadow DOM controls */
.mtf-empty-cart-animation lottie-player::part(controls),
.mtf-empty-cart-animation lottie-player::part(toolbar),
.mtf-empty-cart-animation lottie-player::part(progress),
.mtf-empty-cart-animation lottie-player::part(play-button),
.mtf-empty-cart-animation lottie-player::part(pause-button) {
    display: none !important;
}

/* Ekstra aggressiv CSS for at fjerne alle mulige controls */
.mtf-empty-cart-animation lottie-player > *:not(svg):not(canvas) {
    display: none !important;
}

/* Skjul hover overlay og controls */
.mtf-empty-cart-animation lottie-player:hover > *:not(svg):not(canvas) {
    display: none !important;
}

/* Global override for alle lottie player controls i empty cart */
.mtf-empty-cart-animation lottie-player {
    --lottie-player-toolbar-height: 0px !important;
    --lottie-player-seeker-track-color: transparent !important;
    --lottie-player-seeker-thumb-color: transparent !important;
    filter: grayscale(100%) !important;
}

/* Kraftigere grayscale styling for SVG elementer */
.mtf-empty-cart-animation lottie-player svg {
    filter: grayscale(100%) !important;
}

/* Force alle farver til grayscale på element niveau */
.mtf-empty-cart-animation lottie-player svg * {
    filter: grayscale(100%) !important;
}

.mtf-empty-cart:hover .mtf-empty-cart-animation lottie-player,
.mtf-empty-cart:hover .mtf-empty-cart-animation dotlottie-player {
    opacity: 1;
    transform: scale(1.05);
}

/* Responsive sizing for Lottie animations */
@media (max-width: 768px) {
    .mtf-empty-cart-animation lottie-player,
    .mtf-empty-cart-animation dotlottie-player {
        width: 150px !important;
        height: 150px !important;
        max-width: 150px;
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .mtf-empty-cart-animation lottie-player,
    .mtf-empty-cart-animation dotlottie-player {
        width: 120px !important;
        height: 120px !important;
        max-width: 120px;
        max-height: 120px;
    }
}

/* Content styling */
.mtf-empty-cart-content {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mtf-empty-cart-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.2;
    color: var(--mtf-text-primary);
    text-align: center;
    width: 100%;
}

.mtf-empty-cart-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: var(--mtf-text-secondary);
    margin-bottom: 15px;
    font-style: italic;
    text-align: center;
    width: 100%;
}

.mtf-empty-cart-text {
    font-size: 16px;
    color: var(--mtf-text-secondary);
    margin-bottom: 35px;
    line-height: 1.6;
    max-width: 450px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Action buttons */
.mtf-empty-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    width: 100%;
}

.mtf-empty-cart-primary-btn {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(6, 28, 28, 0.2);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.mtf-empty-cart-primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.mtf-empty-cart-primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(6, 28, 28, 0.3);
}

.mtf-empty-cart-primary-btn:hover::before {
    left: 100%;
}

.mtf-empty-cart-secondary-btn {
    padding: 12px 24px;
    font-size: 14px;
    border: 1px solid var(--mtf-border);
    background: transparent;
    color: var(--mtf-text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
    border-radius: 6px;
    position: relative;
}

.mtf-empty-cart-secondary-btn:hover {
    border-color: var(--mtf-primary);
    color: var(--mtf-primary);
    background: rgba(6, 28, 28, 0.03);
    transform: translateY(-1px);
}

/* Features section */
.mtf-empty-cart-features {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 25px;
    flex-wrap: wrap;
    width: 100%;
}

.mtf-empty-cart-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    min-width: 130px;
    transition: all 0.3s ease;
    padding: 15px;
    border-radius: 8px;
}

.mtf-empty-cart-feature:hover {
    transform: translateY(-5px);
    background: rgba(6, 28, 28, 0.02);
}

.mtf-feature-icon {
    width: 28px;
    height: 28px;
    stroke: var(--mtf-text-secondary);
    transition: all 0.4s ease;
    opacity: 0.7;
}

.mtf-empty-cart-feature:hover .mtf-feature-icon {
    stroke: var(--mtf-primary);
    opacity: 1;
    transform: scale(1.15);
}

.mtf-feature-text {
    font-size: 13px;
    color: var(--mtf-text-secondary);
    font-weight: 500;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.mtf-empty-cart-feature:hover .mtf-feature-text {
    color: var(--mtf-text-primary);
}

/* Button size variants */
.mtf-btn-large {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 12px;
}

.mtf-btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}

.mtf-btn-outline:hover {
    background: currentColor;
    color: white;
}

/* Responsive design for empty cart */
@media (max-width: 768px) {
    .mtf-empty-cart {
        padding: 40px 20px;
        min-height: 350px;
    }

    .mtf-empty-cart-title {
        font-size: 24px;
    }

    .mtf-empty-cart-subtitle {
        font-size: 16px;
    }

    .mtf-empty-cart-text {
        font-size: 15px;
    }

    .mtf-empty-cart-features {
        gap: 20px;
    }

    .mtf-empty-cart-feature {
        min-width: 100px;
    }

    .mtf-empty-cart-actions {
        gap: 12px;
    }

    .mtf-empty-cart-primary-btn {
        min-width: 180px;
        padding: 14px 28px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .mtf-empty-cart {
        padding: 30px 15px;
        min-height: 300px;
    }

    .mtf-empty-cart-features {
        flex-direction: column;
        gap: 15px;
    }

    .mtf-empty-cart-feature {
        flex-direction: row;
        min-width: auto;
        gap: 12px;
    }

    .mtf-feature-icon {
        font-size: 20px;
    }

    .mtf-empty-cart-primary-btn {
        width: 100%;
        min-width: auto;
    }
}

.mtf-continue-shopping {
    display: inline-block;
    background: var(--mtf-primary);
    color: var(--mtf-white);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mtf-continue-shopping:hover {
    background: #0a2a2a;
    text-decoration: none;
    color: var(--mtf-white);
}

/* Button styles */
.mtf-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.mtf-btn-primary {
    background: var(--mtf-primary);
    color: var(--mtf-white);
}

.mtf-btn-primary:hover {
    background: #0a2a2a;
    text-decoration: none;
    color: var(--mtf-white);
}

/* Layout Grid */
.mtf-cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
    position: relative; /* For sticky-stop positioning context */
}

/* Empty cart in grid layout */
.mtf-cart-items .mtf-empty-cart {
    grid-column: 1;
    margin: 0;
}

/* Cart Items */
.mtf-cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mtf-cart-item {
    display: grid;
    grid-template-columns: 100px 1fr 140px;
    gap: 15px;
    padding: 15px;
    background: var(--mtf-gray-bg);
    border-radius: 14px;
    align-items: start;
    position: relative;
}

/* Product Image */
.mtf-cart-item-image {
    width: 100px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--mtf-white);
}

.mtf-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Details */
.mtf-cart-item-details {
    padding-top: 5px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 90px;
}

.mtf-cart-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--mtf-text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.mtf-cart-item-meta {
    font-size: 13px;
    color: var(--mtf-text-secondary);
    line-height: 1.4;
    margin-top: 5px;
}

/* WooCommerce cart item data styling */
.mtf-cart-item-meta dl.variation {
    margin: 0;
    padding: 0;
}

.mtf-cart-item-meta dl.variation dt,
.mtf-cart-item-meta dl.variation dd {
    display: inline;
    margin: 0;
    padding: 0;
    font-size: 13px;
}

.mtf-cart-item-meta dl.variation dt {
    color: var(--mtf-text-secondary);
    font-weight: 400;
}

.mtf-cart-item-meta dl.variation dd {
    color: var(--mtf-text-primary);
    margin-left: 5px;
}

.mtf-cart-item-meta dl.variation dd:after {
    content: '\A';
    white-space: pre;
}

.mtf-cart-item-meta dl.variation dd p {
    display: inline;
    margin: 0;
}

/* Remove extra spacing from WooCommerce default */
.mtf-cart-item-meta .wc-item-meta {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mtf-cart-item-meta .wc-item-meta li {
    margin: 0;
    padding: 0;
    margin-bottom: 3px;
}

/* Quantity Controls in Product Details */
.mtf-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 15px;
}

.mtf-quantity-label {
    font-size: 14px;
    color: var(--mtf-text-primary);
    font-weight: 500;
}

/* Quantity Controls - New Design */
.mtf-quantity-wrapper {
    display: inline-flex;
    align-items: center;
    background: var(--mtf-white) !important;
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    overflow: visible;
    height: 32px;
    width: auto;
}

.mtf-quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent !important;
    color: var(--mtf-text-secondary);
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.mtf-quantity-btn:hover {
    background: var(--mtf-primary) !important;
    color: var(--mtf-white);
    transform: scale(1.05);
    border-radius: 4px;
}

.mtf-quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mtf-quantity-btn.mtf-quantity-minus {
    border-right: 1px solid #d0d0d0;
}

.mtf-quantity-btn.mtf-quantity-plus {
    border-left: 1px solid #d0d0d0;
}

.mtf-quantity-input {
    min-width: 32px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent !important;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--mtf-text-primary);
    padding: 0 !important;
    flex: 0 0 auto;
    transition: width 0.2s ease;
}

.mtf-quantity-input:focus {
    outline: none;
    background: transparent !important;
}

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

/* Override Avada theme styles */
.mtf-cart-wrapper .mtf-quantity-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Confirmation Modal */
.mtf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mtf-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mtf-modal {
    background: var(--mtf-white);
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.mtf-modal-overlay.show .mtf-modal {
    transform: translateY(0);
}

.mtf-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--mtf-text-primary);
    margin-bottom: 15px;
}

.mtf-modal-text {
    font-size: 15px;
    color: var(--mtf-text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.mtf-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mtf-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.mtf-modal-btn-cancel {
    background: var(--mtf-gray-bg);
    color: var(--mtf-text-secondary);
}

.mtf-modal-btn-cancel:hover {
    background: #e5e5e5;
}

.mtf-modal-btn-confirm {
    background: var(--mtf-primary);
    color: var(--mtf-white);
}

.mtf-modal-btn-confirm:hover {
    background: #0a2a2a;
}

/* Toast Notifications */
.mtf-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
}

.mtf-toast {
    background: var(--mtf-white);
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-left: 4px solid var(--mtf-success);
    transform: translateX(100%);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mtf-toast.show {
    transform: translateX(0);
}

.mtf-toast.error {
    border-left-color: var(--mtf-discount-red);
}

.mtf-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.mtf-toast-content {
    flex: 1;
}

.mtf-toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mtf-text-primary);
    margin: 0 0 4px 0;
}

.mtf-toast-message {
    font-size: 13px;
    color: var(--mtf-text-secondary);
    margin: 0;
    line-height: 1.4;
}

.mtf-toast-close {
    background: none;
    border: none;
    color: var(--mtf-text-light);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    line-height: 1;
}

.mtf-toast-close:hover {
    color: var(--mtf-text-secondary);
}

/* Price Section */
.mtf-cart-item-right {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    height: 100%;
    min-height: 90px;
    position: relative;
}

/* Discount Badge */
.mtf-cart-item-right .mtf-discount-badge {
    position: absolute;
    top: 40px;
    right: 0;
    background: #8fa29a;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Price Wrapper */
.mtf-cart-item-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    margin-bottom: 0;
}

/* Original Price (strikethrough) */
.mtf-original-price {
    font-size: 14px;
    color: var(--mtf-text-light);
    text-decoration: line-through;
    opacity: 0.7;
}

/* Product Total */
.mtf-cart-item-total {
    font-size: 16px;
    font-weight: 600;
    color: var(--mtf-text-primary);
}

/* Remove Button */
.mtf-cart-item-remove {
    position: absolute;
    top: 15px;
    right: 15px;
}

.mtf-remove-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    color: #999;
    transition: all 0.2s;
    text-decoration: none;
    opacity: 0.6;
}

.mtf-remove-item:hover {
    color: var(--mtf-discount-red);
    opacity: 1;
}

.mtf-remove-item svg {
    width: 18px;
    height: 18px;
}

/* Cart Actions */
.mtf-cart-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--mtf-border);
}

.mtf-btn-continue-shopping {
    color: var(--mtf-text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.mtf-btn-continue-shopping:hover {
    color: var(--mtf-text-primary);
}

.mtf-btn-continue-shopping svg {
    width: 16px;
    height: 16px;
}

/* Coupon Section */
.mtf-coupon-section {
    margin-top: 15px;
}

.mtf-coupon-form {
    display: flex;
    gap: 0;
}

.mtf-coupon-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--mtf-border);
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    background: var(--mtf-white);
}

.mtf-coupon-input:focus {
    outline: none;
    border-color: var(--mtf-primary);
}

.mtf-btn-coupon {
    padding: 10px 20px;
    background: var(--mtf-primary);
    color: var(--mtf-white);
    border: 1px solid var(--mtf-primary);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.mtf-btn-coupon:hover {
    opacity: 0.9;
}

/* Cart Sidebar */
.mtf-cart-sidebar {
    position: sticky;
    top: 0; /* Aligned with cart-items top, JS handles stop position */
    align-self: start;
}

.mtf-cart-summary {
    background: var(--mtf-gray-bg);
    border-radius: 14px;
    padding: 25px;
}

.mtf-summary-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--mtf-text-primary);
    margin: 0 0 20px 0;
}

.mtf-summary-content {
    margin-bottom: 20px;
    min-height: 50px; /* Ensure it takes up space even if empty */
}

.mtf-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mtf-summary-row:last-child {
    border-bottom: none;
}

.mtf-summary-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--mtf-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mtf-summary-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--mtf-text-primary);
    text-align: right;
    white-space: nowrap;
}

/* Discount Badge */
.mtf-discount-badge {
    background: var(--mtf-discount-red);
    color: var(--mtf-white);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.mtf-discount-value {
    color: #8fa29a;
}

/* Tax row styling */
.mtf-tax-row {
    font-size: 0.9em;
    color: #666 !important;
    font-weight: 400 !important;
}

.mtf-tax-row .mtf-total-label,
.mtf-tax-row .mtf-summary-label {
    color: #666 !important;
    font-weight: 400 !important;
}

.mtf-tax-row .mtf-total-value,
.mtf-tax-row .mtf-summary-value {
    color: #666 !important;
    font-weight: 400 !important;
}

/* Total */
.mtf-summary-total {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.mtf-summary-total .mtf-summary-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--mtf-text-primary);
}

.mtf-summary-total .mtf-summary-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--mtf-text-primary);
}

/* Hide WooCommerce's default tax info inside total */
.mtf-summary-total .mtf-summary-value small.includes_tax {
    display: none;
}

/* Tax info under total */
.mtf-summary-tax-info {
    font-size: 11px;
    color: #999;
    font-weight: 400;
    text-align: right;
    margin-top: -15px;
}

/* Checkout Section */
.mtf-checkout-section {
    margin-top: 20px;
}

/* Reduced spacing for Avada column wrapper */
.fusion-column-wrapper.fusion-column-has-shadow.fusion-flex-justify-content-flex-start.fusion-content-layout-column .mtf-checkout-section {
    margin-top: 0px;
}

/* Add spacing only when promo input is visible */
.fusion-column-wrapper.fusion-column-has-shadow.fusion-flex-justify-content-flex-start.fusion-content-layout-column #mtf-coupon-input[style*="block"] {
    margin-bottom: 15px;
}

/* Rabatkode & Gavekort buttons */
.mtf-promo-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.mtf-promo-btn {
    flex: 1;
    padding: 10px;
    background: var(--mtf-white);
    border: 1px solid var(--mtf-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--mtf-text-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

.mtf-promo-btn:hover {
    background: var(--mtf-gray-bg);
}

.mtf-promo-btn.active {
    background: var(--mtf-primary);
    color: var(--mtf-white);
    border-color: var(--mtf-primary);
}

/* Promo Input Sections */
.mtf-promo-input-section {
    margin-bottom: 15px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mtf-input-wrapper {
    display: inline-flex;
    width: 100%;
    border: 1px solid var(--mtf-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--mtf-white);
}

.mtf-promo-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--mtf-text-primary);
    outline: none;
}

.mtf-promo-input::placeholder {
    color: var(--mtf-text-light);
}

.mtf-apply-btn {
    flex-shrink: 0;
    padding: 12px 20px;
    background: var(--mtf-primary);
    color: var(--mtf-white);
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.mtf-apply-btn:hover {
    opacity: 0.9;
}

/* Checkout Button */
.mtf-btn-checkout {
    width: 100%;
    padding: 14px;
    background: var(--mtf-primary);
    color: var(--mtf-white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.mtf-btn-checkout:hover {
    opacity: 0.9;
    color: var(--mtf-white);
}

/* Trust Section */
.mtf-trust-badges {
    margin-top: 15px;
    text-align: center;
}

.mtf-secure-text {
    font-size: 12px;
    color: var(--mtf-text-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mtf-secure-text svg {
    width: 14px;
    height: 14px;
}

/* Payment Icons */
.mtf-payment-icons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.mtf-payment-icon {
    width: 40px;
    height: 25px;
    background: var(--mtf-white);
    border: 1px solid var(--mtf-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--mtf-text-secondary);
}

/* Vi accepterer text */
.mtf-accept-text {
    font-size: 11px;
    color: var(--mtf-text-light);
    margin-bottom: 8px;
}

/* Loading States */
.mtf-cart-item.updating {
    opacity: 0.6;
    pointer-events: none;
}

.mtf-cart-item.removing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .mtf-cart-layout {
        grid-template-columns: 1fr;
    }

    .mtf-cart-sidebar {
        position: static;
        margin-top: 30px;
    }
}

@media (max-width: 600px) {
    .mtf-cart-container {
        padding: 20px 15px;
    }

    .mtf-cart-item {
        grid-template-columns: 70px 1fr;
        gap: 12px;
        padding: 12px;
    }

    .mtf-cart-item-image {
        width: 70px;
        height: 90px;
    }

    .mtf-cart-item-details {
        grid-column: 2;
    }

    .mtf-cart-item-quantity {
        margin-top: 10px;
    }

    .mtf-cart-item-right {
        position: absolute;
        bottom: 12px;
        right: 12px;
    }

    /* Mobile positioning for discount badge and remove button */
    .mtf-cart-item-right .mtf-discount-badge {
        position: absolute;
        top: 40px;
        left: -60px; /* Move badge to the left */
        right: auto;
    }

    .mtf-cart-item-remove {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 10; /* Ensure remove button is above the badge */
    }

    .mtf-promo-buttons {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    .mtf-cart-actions,
    .mtf-cart-item-remove,
    .mtf-quantity-wrapper,
    .mtf-checkout-section,
    .mtf-coupon-section {
        display: none;
    }
}

/* Minimal Mode */
.mtf-cart-minimal .mtf-cart-header,
.mtf-cart-minimal .mtf-trust-badges {
    display: none;
}

.mtf-cart-minimal .mtf-cart-layout {
    grid-template-columns: 1fr;
}

.mtf-cart-minimal .mtf-cart-sidebar {
    display: none;
}

/* Coupon remove button */
.mtf-remove-coupon {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 2px;
    margin-left: 8px;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mtf-remove-coupon:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

.mtf-remove-coupon svg {
    width: 14px;
    height: 14px;
}

.mtf-coupon-discount {
    /* Remove special styling to match other summary rows */
}

.mtf-coupon-discount .mtf-summary-label {
    display: flex;
    align-items: center;
    width: 100%;
}

.mtf-coupon-discount .mtf-summary-value {
    display: flex;
    align-items: center;
}

.mtf-coupon-discount.removing {
    opacity: 0.6;
    pointer-events: none;
}

/* Gift Card Styles */
.mtf-gift-card-discount {
    /* Special styling for gift cards */
}

.mtf-gift-card-discount .mtf-summary-label {
    display: flex;
    align-items: center;
    color: #8fa29a;
}

/* Gift Card Code with Tooltip */
.mtf-gift-card-code {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted #8fa29a;
}

.mtf-gift-card-code:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: normal;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 5px;
}

.mtf-gift-card-code:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 100;
}

.mtf-gift-card-discount .mtf-summary-value {
    display: flex;
    align-items: center;
    
    color: #8fa29a;
}

/* Gift Card Balance Row */
.mtf-gift-card-balance {
    margin-left: 15px; /* Indent the balance row */
    border-bottom: none;
    padding: 5px 0 !important;
    margin-top: -5px;
}

.mtf-gift-card-remaining {
    font-style: italic;
    color: var(--mtf-text-light) !important;
    font-size: 13px !important;
}

.mtf-gift-card-remaining-value {
    color: var(--mtf-text-light) !important;
    font-size: 13px !important;
    font-weight: normal !important;
}

/* Gavekort info under checkout knap */
.mtf-gift-card-checkout-info {
    margin-top: 15px;
    padding: 12px 16px;
    background: #f0f8ff;
    border-left: 3px solid #8fa29a;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.mtf-gift-card-checkout-info svg {
    width: 18px;
    height: 18px;
    color: #8fa29a;
    flex-shrink: 0;
}

/* Clear Cart Shortcode Styles */
.mtf-clear-cart-btn {
    background: transparent;
    border: 1px solid var(--mtf-border);
    color: var(--mtf-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    text-decoration: none;
}

.mtf-clear-cart-btn:hover {
    border-color: var(--mtf-discount-red);
    color: var(--mtf-discount-red);
    background: rgba(231, 76, 60, 0.05);
}

.mtf-clear-cart-btn:active {
    transform: translateY(1px);
}

/* ================================================================
   NOTIFICATION SYSTEM
   ================================================================ */

.mtf-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    max-width: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mtf-notification-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.mtf-notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: var(--mtf-text-primary);
}

.mtf-notification-close {
    background: none;
    border: none;
    color: var(--mtf-text-light);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mtf-notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--mtf-text-secondary);
}

/* Success Notification */
.mtf-notification-success {
    border-left: 4px solid #27ae60;
}

.mtf-notification-success .mtf-notification-message {
    color: #27ae60;
}

/* Error Notification */
.mtf-notification-error {
    border-left: 4px solid #e74c3c;
}

.mtf-notification-error .mtf-notification-message {
    color: #e74c3c;
}

/* Warning Notification */
.mtf-notification-warning {
    border-left: 4px solid #f39c12;
}

.mtf-notification-warning .mtf-notification-message {
    color: #f39c12;
}

/* Info Notification */
.mtf-notification-info {
    border-left: 4px solid #3498db;
}

.mtf-notification-info .mtf-notification-message {
    color: #3498db;
}

/* Responsive */
@media (max-width: 768px) {
    .mtf-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

/* Button style variant */
.mtf-clear-cart-btn.mtf-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    min-height: 40px;
}

/* Link style variant */
.mtf-clear-cart-link {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none !important;
}

.mtf-clear-cart-link:hover {
    text-decoration: none !important;
}

/* Icon only style variant */
.mtf-clear-cart-icon {
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-height: auto;
}

.mtf-clear-cart-icon svg {
    width: 18px;
    height: 18px;
}

/* Loading state */
.mtf-clear-cart-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.mtf-clear-cart-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Sticky Order Summary Container */
.mtf-order-summary-container {
    transition: all 0.3s ease;
}

.mtf-summary-sticky {
    position: sticky;
    top: 100px;
    z-index: 10000;
    background: var(--mtf-white);
    border-radius: 8px;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-radius 0.3s ease;
}

/* Enhanced styling when sticky activates */
.mtf-summary-sticky.mtf-sticky-enhanced {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--mtf-border);
    border-radius: 14px;
}

/* Removed shadow animation pseudo-element as it was causing layout issues */

/* Responsive sticky behavior */
@media (max-width: 768px) {
    .mtf-summary-sticky {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        transform: none !important;
    }

    .mtf-summary-sticky.mtf-sticky-enhanced {
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
}

/* Ensure parent container creates proper stacking context */
.mtf-cart-sidebar {
    position: relative;
    z-index: 1;
}

/* Ensure sticky element can float over other page elements */
.mtf-summary-sticky {
    isolation: isolate; /* Creates new stacking context */
}

/* Clean up unused override rules */

/* Smooth transitions */
.mtf-summary-sticky * {
    transition: inherit;
}

/* =================================================================== */
/* AVADA THEME OVERRIDES                                             */
/* =================================================================== */

/* Fix: Ensure sticky header appears BEHIND off-canvas overlay on all WooCommerce pages
   The off-canvas overlay uses z-index: 99990, so the header must be lower.
   The .fusion-tb-header has z-index: 100000 by default which is higher than the overlay.

   Solution: Lower the header z-index on cart/checkout/order pages.
   z-index: 9000 is still high enough for normal page scrolling,
   but lower than off-canvas overlay's 99990.

   Applied to: cart, checkout, and order-received (thank you) pages */
.woocommerce-cart .fusion-tb-header,
.woocommerce-checkout .fusion-tb-header,
.woocommerce-order-received .fusion-tb-header {
    z-index: 9000 !important;
}

/* Also reset inner sticky elements to prevent stacking context issues */
.woocommerce-cart .fusion-tb-header .awb-sticky,
.woocommerce-checkout .fusion-tb-header .awb-sticky,
.woocommerce-order-received .fusion-tb-header .awb-sticky {
    z-index: auto !important;
}

/* Note: Padding overrides for specific Avada columns are handled
   directly in Avada Theme Options > Custom CSS for better specificity */
/* =================================================================== */
/* AUTO-OPEN OFF-CANVAS ANIMATIONS                                   */
/* =================================================================== */

/* Highlight animation for newly added item */
@keyframes mtfItemHighlight {
    0% {
        background-color: transparent;
        transform: scale(1);
    }
    15% {
        background-color: #e8f5e9;
        transform: scale(1.02);
    }
    85% {
        background-color: #e8f5e9;
        transform: scale(1.01);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Highlight class for newly added items */
.mtf-cart-item.mtf-item-highlight {
    animation: mtfItemHighlight 2s ease-in-out;
    position: relative;
    z-index: 10;
}

/* Pulse animation for cart icon when item added */
@keyframes mtfCartPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.mtf-cart-icon-pulse {
    animation: mtfCartPulse 0.3s ease-in-out 2;
}

/* Slide in animation for off-canvas */
@keyframes mtfSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mtf-offcanvas-cart-wrapper.mtf-slide-in {
    animation: mtfSlideIn 0.3s ease-out;
}

/* NEW ITEM BADGE */
.mtf-cart-item.mtf-item-highlight::before {
    content: "NY!";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4CAF50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 11;
    animation: mtfBadgeFadeOut 2s ease-in-out forwards;
}

@keyframes mtfBadgeFadeOut {
    0%, 70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Smooth transitions for all cart items */
.mtf-cart-item {
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* =================================================================== */
/* OFF-CANVAS QUICK OPEN OPTIMIZATIONS                               */
/* =================================================================== */

/* Faster transitions for better UX */
.fusion-sliding-bar-area,
.awb-slidingbar,
.mtf-offcanvas-cart-wrapper {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
}

/* Loading state for off-canvas */
.mtf-offcanvas-cart-wrapper.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.mtf-offcanvas-cart-wrapper.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #8fa29a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =================================================================== */
/* RESPONSIVE ENHANCEMENTS - IPAD & MOBILE                           */
/* Added: 2025-11-26                                                  */
/* Purpose: Optimize cart for iPad and mobile devices                */
/* =================================================================== */

/* ===================================================================
   IPAD BREAKPOINT (834px - 968px)
   Target: iPad portrait mode
   Focus: Touch-friendly interactions and optimized spacing
   =================================================================== */

@media (min-width: 834px) and (max-width: 968px) {

    /* Product Images - Optimized size between mobile and desktop */
    .mtf-cart-item-image {
        width: 85px;
        height: 102px;
    }

    /* Touch Targets - iOS HIG compliant (44x44px minimum) */
    .mtf-quantity-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }

    .mtf-quantity-wrapper {
        height: 44px;
    }

    .mtf-quantity-input {
        min-width: 44px;
        width: 44px;
        height: 44px;
    }

    /* Remove button - Touch-friendly sizing */
    .mtf-remove-item {
        width: 44px;
        height: 44px;
    }

    .mtf-remove-item svg {
        width: 20px;
        height: 20px;
    }

    /* Promo Apply Buttons - Touch-friendly */
    .mtf-apply-btn {
        min-height: 44px;
        padding: 12px 24px;
    }

    /* Promo Toggle Buttons */
    .mtf-promo-btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Checkout Button - Prominent and easy to tap */
    .mtf-btn-checkout {
        min-height: 48px;
        padding: 16px 24px;
        font-size: 16px;
    }

    /* Cart Item Spacing - Enhanced breathing room */
    .mtf-cart-item-details {
        padding-top: 8px;
    }

    .mtf-cart-item {
        padding: 16px;
        gap: 16px;
        margin-bottom: 16px;
    }

    /* Grid Spacing - Optimized for tablet viewing */
    .mtf-cart-items {
        gap: 16px;
    }

    /* Empty Cart Primary Button - Touch-friendly */
    .mtf-empty-cart-primary-btn {
        min-height: 48px;
        padding: 16px 36px;
        font-size: 16px;
    }

    /* Clear Cart Button - Touch-friendly */
    .mtf-clear-cart-btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    /* Coupon Input Section */
    .mtf-promo-input {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Input Wrapper */
    .mtf-input-wrapper {
        min-height: 44px;
    }
}

/* ===================================================================
   MOBILE OPTIMIZATIONS (<834px)
   Target: Mobile phones
   Focus: Compact layout with touch-friendly interactions
   =================================================================== */

@media (max-width: 833px) {

    /* ===========================================
       MOBILE LAYOUT FIX - Complete restructure
       =========================================== */

    /* Cart item - Clean grid layout for mobile */
    .mtf-cart-item {
        display: grid;
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        padding: 16px;
        position: relative;
    }

    /* Image container */
    .mtf-cart-item-image {
        grid-row: 1 / 3;
        width: 80px;
        height: 100px;
    }

    /* Product details - name and variations */
    .mtf-cart-item-details {
        grid-column: 2;
        grid-row: 1;
        padding-right: 40px; /* Space for remove button */
    }

    /* Product name - readable size */
    .mtf-cart-item-name {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    /* Quantity and price row */
    .mtf-cart-item-quantity {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 0;
    }

    /* Remove button - top right corner */
    .mtf-cart-item-remove {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f5f5;
        border-radius: 50%;
        z-index: 10;
    }

    .mtf-cart-item-remove svg {
        width: 16px;
        height: 16px;
    }

    /* Discount badge - next to price, not overlapping */
    .mtf-discount-badge {
        position: static !important;
        display: inline-block;
        font-size: 11px;
        padding: 2px 6px;
        margin-right: 8px;
    }

    /* Price section - inline with badge */
    .mtf-cart-item-right {
        position: static !important;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mtf-cart-item-prices {
        text-align: right;
    }

    .mtf-price-original {
        font-size: 12px;
    }

    .mtf-price-current {
        font-size: 15px;
        font-weight: 600;
    }

    /* ===========================================
       TOUCH TARGETS - 44px minimum
       =========================================== */

    /* Quantity buttons */
    .mtf-quantity-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .mtf-quantity-wrapper {
        height: 44px;
    }

    .mtf-quantity-input {
        min-width: 44px;
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    /* Promo Apply Buttons - Touch-friendly */
    .mtf-apply-btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    /* Promo Toggle Buttons - Stack on mobile */
    .mtf-promo-btn {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Checkout Button */
    .mtf-btn-checkout {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 16px;
    }

    /* Empty Cart Primary Button */
    .mtf-empty-cart-primary-btn {
        min-height: 48px;
        padding: 14px 32px;
    }

    /* Clear Cart Button */
    .mtf-clear-cart-btn {
        min-height: 44px;
        padding: 8px 16px;
    }

    /* Coupon Input */
    .mtf-promo-input {
        min-height: 44px;
        padding: 12px 15px;
        font-size: 16px; /* Prevent iOS zoom */
    }

    /* Input Wrapper */
    .mtf-input-wrapper {
        min-height: 44px;
    }

    /* Adequate spacing between touch targets */
    .mtf-cart-item-quantity {
        gap: 12px;
        padding-top: 12px;
    }

    /* Promo buttons spacing */
    .mtf-promo-buttons {
        gap: 12px;
    }

    /* ===========================================
       PRODUCT VARIATIONS - Compact display
       =========================================== */

    /* Hide long variation lists on mobile - show collapsed */
    .mtf-cart-item-variations {
        max-height: 60px;
        overflow: hidden;
        position: relative;
        font-size: 12px;
        line-height: 1.4;
    }

    .mtf-cart-item-variations::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 20px;
        background: linear-gradient(transparent, white);
    }

    /* Variation items - compact */
    .mtf-variation-item {
        display: inline;
        margin-right: 8px;
    }

    .mtf-variation-item::after {
        content: ' · ';
    }

    .mtf-variation-item:last-child::after {
        content: '';
    }

    /* Order summary on mobile */
    .mtf-order-summary {
        margin-top: 24px;
    }

    .mtf-order-summary-title {
        font-size: 18px;
    }
}

/* ===================================================================
   DESKTOP ENHANCEMENTS (>968px)
   Ensure existing desktop experience is preserved
   =================================================================== */

@media (min-width: 968px) {

    /* Desktop maintains 100px images (existing behavior) */
    .mtf-cart-item-image {
        width: 100px;
        height: 120px;
    }

    /* Desktop button sizing - comfortable for mouse */
    .mtf-quantity-btn {
        width: 32px;
        height: 32px;
    }

    .mtf-quantity-wrapper {
        height: 32px;
    }

    .mtf-quantity-input {
        min-width: 32px;
        width: 32px;
        height: 32px;
    }

    /* Desktop remove button */
    .mtf-remove-item {
        width: 28px;
        height: 28px;
    }

    .mtf-remove-item svg {
        width: 18px;
        height: 18px;
    }
}

/* ===================================================================
   MOBILE/TABLET FIX - Disable sticky sidebar + prevent hero overlap
   Must come AFTER 833px rules to properly cascade
   Added: 2026-01-13 - Fix for sticky sidebar and hero overlap on mobile
   =================================================================== */

@media (max-width: 968px) {
    /* DISABLE sticky sidebar on mobile/tablet */
    .mtf-cart-sidebar {
        position: static !important;
        top: auto !important;
        align-self: auto !important;
        background: #fff !important;
        margin-top: 30px !important;
        padding: 20px !important;
    }

    /* Ensure cart container has proper background */
    .mtf-cart-container {
        background: #fff !important;
        padding-bottom: 30px !important;
    }

    /* Order summary styling */
    .mtf-cart-summary,
    .mtf-order-summary-container,
    #mtf-order-summary {
        background: #f8f8f8 !important;
        border-radius: 12px !important;
    }

    /* Ensure proper stacking over hero section */
    .fusion-fullwidth:has(.mtf-cart-container) {
        background: #fff !important;
        position: relative !important;
        z-index: 10 !important;
    }
}

@media (max-width: 600px) {
    /* Fix grid overflow - ensure items fit in container */
    .mtf-cart-layout {
        grid-template-columns: 1fr !important;
    }

    .mtf-cart-main,
    .mtf-cart-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Cart item - proper 2-column grid */
    .mtf-cart-item {
        grid-template-columns: 70px 1fr !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Price section - absolute position to remove from grid flow */
    .mtf-cart-item-right {
        position: absolute !important;
        bottom: 12px;
        right: 12px;
        width: auto !important;
    }
}
