/**
 * MFN Cart Holder Enhanced - Versão Melhorada
 * Sistema de carrinho lateral otimizado e moderno
 */

/* ===== CONTAINER PRINCIPAL DO CARRINHO ===== */
.mfn-cart-holder {
    font-size: 14px !important; /* Fonte mais compacta */
    line-height: 1.4 !important;
}

/* ===== BOTÃO FECHAR ROXO NO CANTO ESQUERDO ===== */
.mfn-close-button-purple {
    position: absolute !important;
    top: 15px;
    left: 15px;
    z-index: 1000;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
    border: none;
    font-weight: bold;
}

.mfn-close-button-purple:hover,
.mfn-close-button-purple:focus {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%) !important;
    color: #fff !important;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.mfn-close-button-purple .close-icon {
    font-size: 20px;
    line-height: 1;
    display: block;
}

/* ===== REMOVE HEADER ANTIGO ===== */
.mfn-ch-row.mfn-ch-header {
    display: none !important;
}

/* ===== CONTENT AREA OTIMIZADA ===== */
.mfn-ch-content-wrapper {
    padding: 5px 7px 0 7px !important;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.mfn-ch-content {
    padding: 10px 0 !important;
}

/* ===== FOOTER SIMPLIFICADO ===== */
.mfn-ch-footer {
    padding: 20px !important;
    border-top: 1px solid #e8e8e8;
    background: #f9f9f9;
    margin-top: auto;
}

.mfn-ch-footer-totals {
    margin-bottom: 15px;
    font-size: 13px !important; /* Fonte mais compacta */
}

.mfn-ch-footer-buttons {
    margin-bottom: 0px;
}

.mfn-ch-footer-buttons .button_checkout_primary {
    display: block;
    width: 100%;
    font-size: 13px !important; 
    font-weight: 600;
    padding: 16px 20px !important;
    text-align: center;
    border-radius: 8px;
    background: #2c5530 !important;
    color: #fff !important;
    border: none;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(44, 85, 48, 0.25);
}

.mfn-ch-footer-buttons .button_checkout_primary:hover {
    background: #1e3a21 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 85, 48, 0.35);
}

/* ===== LINK CONTINUAR COMPRANDO ===== */
.mfn-ch-continue-shopping {
    text-align: center;
    margin-top: 0px;
}

.continue-shopping-link {
    font-size: 14px !important;
    color: #666 !important;
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.3s ease;
}

.continue-shopping-link:hover,
.continue-shopping-link:focus {
    color: #2c5530 !important;
    text-decoration: none;
}

/* ===== REMOVE LINKS DO FOOTER ===== */
.mfn-ch-footer-links {
    display: none !important;
}

/* ===== ITENS DO CARRINHO MAIS COMPACTOS ===== */
.mfn-cart-holder .woocommerce-mini-cart-item {
    padding: 10px 0 !important;
    font-size: 13px !important;
    border-bottom: 1px solid #f0f0f0;
}

.mfn-cart-holder .woocommerce-mini-cart-item:last-child {
    border-bottom: none;
}

.mfn-cart-holder .woocommerce-mini-cart-item a {
    font-size: 13px !important;
    line-height: 1.3 !important;
}

.mfn-cart-holder .quantity {
    font-size: 12px !important;
    color: #888;
}

.mfn-cart-holder .amount {
    font-size: 14px !important;
    font-weight: 600;
    color: #2c5530 !important;
    display: inline !important;
}

/* ===== PRODUTOS DO CARRINHO - ELEMENTOS ESPECÍFICOS ===== */

/* Nome do produto - 14px */
.mfn-cart-holder .mfn-chp-name,
.mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-name {
    font-size: 14px !important;
    line-height: 1.3 !important;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

/* Imagem do produto - 85px */
.mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-image a img {  
    width: 85px !important;
    height: 85px !important;
    object-fit: cover;
    border-radius: 6px;
}

/* Container da imagem */
.mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-image {
    flex-shrink: 0;
    margin-right: 12px;
}

/* ===== NOME DO PRODUTO E BOTÃO DE REMOÇÃO NA MESMA LINHA ===== */
.mfn-cart-holder .mfn-chp-name-remove {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.mfn-cart-holder .mfn-chp-name-remove .mfn-chp-name {
    flex: 1;
    margin: 0;
    margin-right: 10px;
}

.mfn-cart-holder .mfn-chp-name-remove .mfn-chp-remove {
    color: #ccc !important;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.mfn-cart-holder .mfn-chp-name-remove .mfn-chp-remove:hover {
    color: #ff4444 !important;
}

/* ===== PREÇO E QUANTIDADE NA MESMA LINHA ===== */
.mfn-cart-holder .mfn-chp-price-quantity {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.mfn-cart-holder .mfn-chp-price-quantity p.price {
    margin: 0;
    font-size: 13px !important;
    font-weight: 600;
    color: #2c5530 !important;
    flex: 1;
}

.mfn-cart-holder .mfn-chp-price-quantity p.price .woocommerce-Price-amount {
    font-size: 13px !important;
    font-weight: 700;
    color: #2c5530 !important;
}

.mfn-cart-holder .mfn-chp-price-quantity .mfn-chp-quantity {
    margin-left: 10px;
    flex-shrink: 0;
}



/* Quantidade do produto - estilo compacto e bonito */
.mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-quantity {
    font-size: 12px !important;
    color: #666;
}

.mfn-cart-holder .mfn-chp-quantity input[type="number"] {
    width: 100% !important;
    height: 28px !important;
    padding: 4px 6px !important;
    font-size: 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    text-align: center !important;
    background: #fff !important;
    color: #333 !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1) !important;
    transition: all 0.2s ease !important;
}

.mfn-cart-holder .mfn-chp-quantity input[type="number"]:focus {
    border-color: #2c5530 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(44, 85, 48, 0.1), inset 0 1px 3px rgba(0,0,0,0.1) !important;
}

.mfn-cart-holder .mfn-chp-quantity input[type="number"]:hover {
    border-color: #bbb !important;
}

/* Remove setas do input number no webkit */
.mfn-cart-holder .mfn-chp-quantity input[type="number"]::-webkit-outer-spin-button,
.mfn-cart-holder .mfn-chp-quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}


/* Layout do produto no carrinho */
.mfn-cart-holder .mfn-ch-content .mfn-ch-product {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 7px;
}

.mfn-cart-holder .mfn-ch-content .mfn-ch-product:last-child {
    border-bottom: none;
}

/* Informações do produto (nome, preço, quantidade) */
.mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 88px;
}

.mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-desc {
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* Link do nome do produto */
.mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-name a {
    color: #333 !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-name a:hover {
    color: #2c5530 !important;
}

/* Garantir que não existem conflitos com WooCommerce padrão */
.mfn-cart-holder .mfn-ch-content .woocommerce-mini-cart-item {
    display: block !important;
}

/* Compatibilidade com mini-cart padrão do WooCommerce */
.mfn-cart-holder .woocommerce-mini-cart {
    padding: 0;
    margin: 0;
}

.mfn-cart-holder .woocommerce-mini-cart li {
    list-style: none;
    margin: 0;
    padding: 0;
}




/* ===== TOTALS MAIS COMPACTOS ===== */
.mfn-cart-holder .woocommerce-mini-cart__total {
    font-size: 14px !important;
    font-weight: 600;
    padding: 8px 0;
    border-top: 1px solid #e8e8e8;
    margin-top: 10px;
}

/* ===== TOTAL REORGANIZADO COM SUBTOTAL RISCADO ===== */
.mfn-cart-holder .mfn-chft-total-amount {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.mfn-cart-holder .mfn-chft-total .mfn-subtotal-original {
    text-decoration: line-through !important;
    color: #999 !important;
    font-size: 12px !important;
    opacity: 0.7;
}

.mfn-cart-holder .mfn-chft-total .woocommerce-Price-amount {
    color: #2c5530 !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .mfn-close-button-purple {
        top: 10px;
        left: 10px;
        width: 32px;
        height: 32px;
    }
    
    .mfn-close-button-purple .close-icon {
        font-size: 18px;
    }
    
    .mfn-ch-content-wrapper {
        padding: 5px 5px 0 5px !important;
        max-height: calc(100vh - 180px);
    }
    
    .mfn-ch-footer {
        padding: 15px !important;
    }
    
    .mfn-ch-footer-buttons .button_checkout_primary {
        font-size: 13px !important;
        padding: 14px 18px !important;
    }
    
    .continue-shopping-link {
        font-size: 13px !important;
    }
    
    /* ===== PRODUTOS DO CARRINHO - RESPONSIVO ===== */
    
    /* Nome do produto - mobile */
    .mfn-cart-holder .mfn-chp-name,
    .mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-name {
        font-size: 13px !important;
    }
    
    /* Imagem do produto - mobile (um pouco menor) */
    .mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-image a img {  
        width: 75px !important;
        height: 75px !important;
    }
    
    /* Container da imagem - mobile */
    .mfn-cart-holder .mfn-ch-content .mfn-ch-product .mfn-chp-image {
        margin-right: 10px;
    }
    
    /* Preços - mobile */
    .mfn-cart-holder .mfn-ch-content .mfn-ch-product .woocommerce-Price-amount,
    .mfn-cart-holder .woocommerce-mini-cart-item .amount,
    .mfn-cart-holder .mfn-ch-content .amount,
    .mfn-cart-holder .woocommerce-Price-amount,
    .mfn-cart-holder span.amount {
        font-size: 13px !important;
    }
    
    /* Layout do produto - mobile */
    .mfn-cart-holder .mfn-ch-content .mfn-ch-product {
        padding: 10px 0;
    }
}

/* ===== ANIMAÇÕES SUAVES ===== */
.mfn-cart-holder * {
    transition: all 0.2s ease;
}

/* ===== ANIMAÇÃO DE FECHAMENTO ===== */
.mfn-cart-holder.closing {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.mfn-cart-overlay.closing {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* ===== SCROLLBAR CUSTOMIZADA ===== */
.mfn-ch-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.mfn-ch-content-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.mfn-ch-content-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.mfn-ch-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== ESTADOS DE CARREGAMENTO ===== */
.mfn-cart-holder.loading {
    opacity: 0.7;
    pointer-events: none;
}

.mfn-cart-holder.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2c5530;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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