/* =========================================
   MCE MINIMAL CART - MAGICAL SCROLLING VERSION
   ========================================= */

/* Ukryj footer i header DIVI na stronie koszyka */
.woocommerce-cart footer.et-l.et-l--footer,
body.woocommerce-cart footer.et-l--footer {
    display: none !important;
}

.woocommerce-cart header.lunaria-main-header,
body.woocommerce-cart header.lunaria-main-header {
    display: none !important;
}

/* Dodaj padding na dole body dla sticky footer */
body.woocommerce-cart {
    padding-bottom: 0 !important;
}

.mce-minimal-cart-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0,0,0,0.1);
}

/* --- KONTENER PRZYCISKU WRÓĆ --- */
.mce-back-container {
    background: #fff;
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
}

/* --- PRZYCISK WRÓĆ DO SKLEPU --- */
.mce-back-button {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
}

.mce-back-button:hover {
    color: #764ba2;
    background: rgba(118, 75, 162, 0.05);
    transform: translateX(-3px);
}

.mce-back-button::before {
    content: '←';
    font-size: 18px;
}

/* --- MAGICZNY NAGŁÓWEK --- */
.mce-cart-header {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 30px 20px 25px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(118, 75, 162, 0.3);
    z-index: 100;
}

.mce-cart-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zm20.97 0l9.315 9.314-1.414 1.414L34.828 0h2.83zM22.344 0L13.03 9.314l1.414 1.414L25.172 0h-2.83zM32 0l12.142 12.142-1.414 1.414L30 .828 17.272 13.556 15.858 12.14 28 0zm4.686 0L48.97 12.284l-1.414 1.414L35.272 1.414 36.686 0zm-9.372 0l-1.414 1.414L13.616 13.698l-1.414-1.414L27.314 0zm32.284 48.97L47.313 61.255l-1.414-1.414 14.07-14.07 1.415 1.414zm-50.196 0l-1.414 1.414L22.344 65 23.758 63.586 7.402 47.23l1.414-1.414L23.758 60.758 38.686 45.828l1.414 1.414L25.172 62.172 8.816 45.816l1.414-1.414L25.172 59.344 41.528 42.988l1.414 1.414L27.314 59.93 10.958 43.574l1.414-1.414L27.314 57.102 43.67 40.746l1.414 1.414L29.728 57.516 13.372 41.16l1.414-1.414L29.728 54.688 46.084 38.332l1.414 1.414L32.142 55.102 15.786 38.746l1.414-1.414L32.142 52.274 48.498 35.918l1.414 1.414L34.556 52.688 18.2 36.332l1.414-1.414L34.556 49.86 50.912 33.504l1.414 1.414L36.97 50.274 20.614 33.918l1.414-1.414L36.97 47.446 53.326 31.09l1.414 1.414L39.384 47.86 23.028 31.504l1.414-1.414L39.384 45.032 55.74 28.676l1.414 1.414L41.798 45.446 25.442 29.09l1.414-1.414L41.798 42.618 58.154 26.262l1.414 1.414L44.212 43.032 27.856 26.676l1.414-1.414L44.212 40.204 60.568 23.848l1.414 1.414L46.626 40.618 30.27 24.262l1.414-1.414L46.626 37.79z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
    animation: magicFloat 20s ease-in-out infinite;
}

@keyframes magicFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(10px, -10px) rotate(5deg); }
    66% { transform: translate(-10px, 10px) rotate(-5deg); }
}

.mce-cart-title {
    position: relative;
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3), 0 0 40px rgba(246, 147, 251, 0.4); }
    50% { text-shadow: 0 4px 30px rgba(255, 255, 255, 0.6), 0 0 60px rgba(246, 147, 251, 0.6); }
}

/* --- PRZEWIJALNY KONTENER PRODUKTÓW --- */
.mce-scrollable-content {
    position: relative;
    overflow-y: visible;
    overflow-x: hidden;
    padding: 20px;
    padding-bottom: 100px; /* Miejsce na sticky footer */
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.mce-scrollable-content::-webkit-scrollbar {
    width: 8px;
}

.mce-scrollable-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.mce-scrollable-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.mce-scrollable-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #f093fb);
}

/* --- Karta Produktu --- */
.mce-cart-card {
    display: flex;
    gap: 15px;
    background: #fff;
    border: 1px solid var(--lunaria-border-light, #e1e1e1);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    position: relative;
    animation: cardSlideIn 0.5s ease-out backwards;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mce-cart-card:nth-child(2) { animation-delay: 0.1s; }
.mce-cart-card:nth-child(3) { animation-delay: 0.2s; }
.mce-cart-card:nth-child(4) { animation-delay: 0.3s; }
.mce-cart-card:nth-child(5) { animation-delay: 0.4s; }

.mce-cart-card:hover {
    border-color: var(--lunaria-secondary, #8e44ad);
    box-shadow: 0 8px 25px rgba(142, 68, 173, 0.15);
    transform: translateY(-2px);
}

/* Obrazek */
.mce-card-image {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
}

.mce-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.mce-cart-card:hover .mce-card-image img {
    transform: scale(1.05);
}

/* Detale */
.mce-card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mce-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.mce-product-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--lunaria-text-main, #333);
    margin: 0;
    line-height: 1.3;
    padding-right: 25px;
    text-decoration: none;
    transition: color 0.2s;
}

.mce-product-title:hover {
    color: #764ba2;
}

/* Przycisk Usuń (X) */
.mce-remove-item {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #aaa;
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
    transition: all 0.3s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.mce-remove-item:hover {
    color: #fff;
    background: var(--lunaria-fire, #c0392b);
    transform: rotate(90deg);
}

/* Stopka karty (Ilość i Cena) */
.mce-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.mce-item-price {
    font-weight: 700;
    color: var(--lunaria-primary, #5e2a84);
    font-size: 15px;
}

/* --- Pigułka Ilości (+/-) --- */
.mce-qty-control {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    overflow: hidden;
    height: 38px;
    width: 105px;
    background: #fff;
    transition: border-color 0.3s;
}

.mce-qty-control:hover {
    border-color: #764ba2;
}

.mce-qty-btn {
    width: 32px;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--lunaria-primary, #764ba2);
    cursor: pointer;
    display: flex; 
    align-items: center; 
    justify-content: center;
    padding-bottom: 3px;
    transition: all 0.2s;
}

.mce-qty-btn:hover { 
    background: linear-gradient(135deg, #667eea22, #764ba222);
    color: #5e2a84;
}

.mce-qty-btn:active {
    transform: scale(0.9);
}

/* Ukrywamy standardowe style inputa WC */
.mce-qty-control .quantity {
    margin: 0;
    border: none;
    padding: 0;
    width: 41px;
}

.mce-qty-control input.mce-qty-input {
    width: 41px !important;
    height: 100% !important;
    border: none !important;
    text-align: center;
    font-size: 14px !important;
    font-weight: 600;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    -moz-appearance: textfield;
}

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

/* --- STICKY FOOTER (przyklejony do dołu kontenera) --- */
.mce-sticky-checkout {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    z-index: 100;
    padding: 18px 20px;
    box-sizing: border-box;
    border-top: 3px solid #764ba2;
    border-radius: 0 0 20px 20px;
}

.mce-sticky-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.mce-total-col {
    display: flex;
    flex-direction: column;
}

.mce-total-label { 
    font-size: 11px; 
    text-transform: uppercase; 
    color: #999;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.mce-total-amount { 
    font-size: 24px; 
    font-weight: 800; 
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mce-checkout-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    padding: 14px 32px;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 14px;
    letter-spacing: 0.5px;
}

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

.mce-checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(118, 75, 162, 0.5);
}

.mce-checkout-btn:hover::before {
    left: 100%;
}

.mce-checkout-btn:active {
    transform: translateY(-1px);
}

/* Pusty koszyk */
.mce-cart-empty { 
    text-align: center; 
    padding: 80px 20px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.mce-empty-icon { 
    font-size: 80px; 
    display: block; 
    margin-bottom: 20px; 
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mce-empty-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 10px;
}

.mce-btn-continue { 
    display: inline-block; 
    margin-top: 20px; 
    padding: 12px 30px; 
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; 
    border-radius: 50px; 
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
}

.mce-btn-continue:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.4);
}

/* Responsywność */
@media (max-width: 768px) {
    .mce-minimal-cart-wrapper {
        border-radius: 0;
    }

    .mce-cart-title {
        font-size: 26px;
    }
    
    .mce-scrollable-content {
        padding-bottom: 100px;
    }
    
    .mce-sticky-checkout {
        padding: 15px;
        border-radius: 0;
    }
    
    .mce-total-amount {
        font-size: 20px;
    }
    
    .mce-checkout-btn {
        padding: 12px 24px;
        font-size: 13px;
    }
}