/**
 * Off Canvas Cart Styles
 *
 * Minimal styling - genbruger hovedsageligt Cart.css styling
 * Kun wrapper struktur, sticky positioning og scrolling
 *
 * @package Made_To_Fit
 * @version 1.1.0
 */

/* =============================================================================
   WRAPPER & CONTAINER
   ============================================================================= */

.mtf-offcanvas-cart-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%; /* Fylder hele Off Canvas containeren (100vh) */
    max-width: 100%; /* Passer til Off Canvas bredde */
    margin: 0;
    padding: 0;
    background: transparent;
}

/* =============================================================================
   HEADER (STICKY TOP) - SIMPEL
   ============================================================================= */

.mtf-offcanvas-cart-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 25px 0 16px 0; /* Top padding fra Off Canvas top */
}

/* Gradient fade-in effekt fra toppen - fast i off-canvas top */
.mtf-offcanvas-cart-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 110px;
    background-image: linear-gradient(to bottom,
        white 0px,
        white 30px,
        rgba(255, 255, 255, 0.95) 50px,
        rgba(255, 255, 255, 0.85) 70px,
        rgba(255, 255, 255, 0.6) 90px,
        rgba(255, 255, 255, 0) 110px
    );
    pointer-events: none;
    z-index: -1;
}

/* Header indhold skal være over gradienten */
.mtf-offcanvas-cart-title,
.mtf-offcanvas-cart-count {
    position: relative;
    z-index: 1;
}

.mtf-offcanvas-cart-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #1a1a1a;
    line-height: 1.3;
}

.mtf-offcanvas-cart-count {
    font-size: 13px;
    color: #666;
    margin: 0;
    font-weight: 400;
}

/* =============================================================================
   SCROLLABLE CONTENT AREA
   ============================================================================= */

.mtf-offcanvas-cart-items {
    flex: 1; /* Fylder tilgængelig plads mellem header og footer */
    overflow-y: auto; /* Kun denne sektion scroller */
    overflow-x: hidden;
    padding: 0; /* Ingen padding - Off Canvas container håndterer det */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling på iOS */
}

/* Scrollbar styling */
.mtf-offcanvas-cart-items::-webkit-scrollbar {
    width: 6px;
}

.mtf-offcanvas-cart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mtf-offcanvas-cart-items::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.mtf-offcanvas-cart-items::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* =============================================================================
   CART ITEM LAYOUT ADJUSTMENTS FOR OFF CANVAS
   ============================================================================= */

/* Adjust grid to fit narrower Off Canvas container */
.mtf-offcanvas-cart-wrapper .mtf-cart-item {
    grid-template-columns: 80px 1fr 110px; /* Reduced from 100px 1fr 140px */
    gap: 12px; /* Reduced from 15px */
    padding: 12px; /* Reduced from 15px */
}

/* Adjust image size proportionally */
.mtf-offcanvas-cart-wrapper .mtf-cart-item-image {
    width: 80px;
    height: 100px;
}

/* Reduce right column content sizes */
.mtf-offcanvas-cart-wrapper .mtf-cart-item-total {
    font-size: 15px; /* Reduced from 16px */
}

/* Reduce right column content sizes */
.mtf-offcanvas-cart-wrapper .mtf-original-price {
    font-size: 13px; /* Reduced from 14px */
    transform: translateY(10px);
}

/* Ensure price wrapper doesn't overflow */
.mtf-offcanvas-cart-wrapper .mtf-cart-item-price-wrapper {
    max-width: 100%;
    overflow: hidden;
}

/* Adjust discount badge positioning */
.mtf-offcanvas-cart-wrapper .mtf-discount-badge {
    font-size: 10px; /* Reduced from 11px */
    padding: 2px 6px;
    top: 28px; /* Move up to avoid overlapping with price */
}

/* Adjust remove button positioning */
.mtf-offcanvas-cart-wrapper .mtf-remove-item {
    transform: translateY(-5px);
}

/* =============================================================================
   FOOTER - SIMPEL STICKY BUTTON
   ============================================================================= */

.mtf-offcanvas-cart-footer {
    position: sticky; /* Sticky i forhold til container, IKKE viewport */
    bottom: 0; /* Fast i bunden af Off Canvas containeren */
    z-index: 101;
    background-image: linear-gradient(to top,
        white 0px,
        white 30px,
        rgba(255, 255, 255, 0.95) 50px,
        rgba(255, 255, 255, 0.85) 70px,
        rgba(255, 255, 255, 0.6) 90px,
        rgba(255, 255, 255, 0) 110px
    );
    padding: 16px 0 0 0; /* Kun top padding for spacing */
    padding-top: 90px; /* Plads til gradient fade - 110px gradient minus 20px afstand */
    margin-top: auto; /* Skubber sig til bunden hvis der er lidt indhold */
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Go to Cart Button - Brug standard MTF button styling */
.mtf-offcanvas-cart-footer .mtf-go-to-cart-btn {
    width: 200px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    transform: translateY(-20px);
    position: relative;
    z-index: 2;
}

.mtf-offcanvas-cart-footer .mtf-go-to-cart-btn:hover {
    background: #333;
}

.mtf-offcanvas-cart-footer .mtf-go-to-cart-btn svg {
    width: 16px;
    height: 16px;
}

/* Totals til højre for knappen */
.mtf-offcanvas-cart-totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    position: relative;
    top: -25px; /* Changed from -20px to -25px */
    left: 5px; /* Added */
}

.mtf-offcanvas-subtotal {
    font-size: 13px;
    color: #666;
    font-weight: 400;
    position: relative; /* Added */
    top: 10px; /* Added */
    text-decoration: line-through; /* Added */
}

.mtf-offcanvas-subtotal.has-discount {
    text-decoration: line-through;
    color: #999;
}

.mtf-offcanvas-total {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    position: relative;
    left: 5px;
}

/* =============================================================================
   EMPTY CART STATE
   ============================================================================= */

.mtf-offcanvas-empty {
    padding: 40px 0;
    text-align: center;
    background: none;
    border: none;
    box-shadow: none;
    margin: 20px 0;
    top: 30px;
}

.mtf-offcanvas-empty .mtf-empty-cart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mtf-offcanvas-empty .mtf-empty-cart-animation {
    margin-bottom: 20px;
}

.mtf-offcanvas-empty .mtf-empty-cart-animation lottie-player {
    width: 200px !important;
    height: 200px !important;
}

.mtf-offcanvas-empty .mtf-empty-cart-content {
    max-width: 100%;
}

.mtf-offcanvas-empty .mtf-empty-cart-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1a1a1a;
    line-height: 1.2;
}

.mtf-offcanvas-empty .mtf-empty-cart-text {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.5;
    padding: 0 20px;
}

.mtf-offcanvas-empty .mtf-empty-cart-actions {
    margin-top: 24px;
}

.mtf-offcanvas-empty .mtf-empty-cart-primary-btn {
    width: 100%;
    max-width: 280px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.mtf-offcanvas-empty .mtf-empty-cart-primary-btn:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =============================================================================
   LOADING STATES
   ============================================================================= */

.mtf-offcanvas-cart-wrapper .mtf-cart-item.updating {
    opacity: 0.6;
    pointer-events: none;
}

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

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(20px);
        height: 0;
        padding: 0;
        margin: 0;
    }
}