/* assets/css/mini-cart.css */
/* v1.1 - COMPLETO: altura corrigida, contador oculto quando vazio, botão loja funcional */

/* ========== WRAPPER PRINCIPAL ========== */
.spz-mini-cart-wrapper {
    position: relative;
    display: inline-block;
}

/* ========== ÍCONE TRIGGER ========== */
.spz-mini-cart-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.spz-mini-cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    width: 24px;
    height: 24px;
}

.spz-mini-cart-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.spz-mini-cart-icon i {
    font-size: 24px;
}

/* ========== CONTADOR ========== */
.spz-mini-cart-count {
    position: absolute;
    top: -50%;
    right: 50%;
    background: #A080D8;
    color: #1E1E1E;
    font-size: 11px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    box-sizing: border-box;
}

/* ========== OVERLAY ========== */
.spz-mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.spz-mini-cart-wrapper.is-open .spz-mini-cart-overlay {
    opacity: 1;
    visibility: visible;
}

/* ========== DRAWER ========== */
.spz-mini-cart-drawer {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 99999;
    background: #1E1E1E;
    border: 1px solid #A080D8;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.spz-mini-cart-wrapper.is-open .spz-mini-cart-drawer {
    transform: translateX(-50%) translateY(20px);
}

/* ========== TÍTULO ========== */
.spz-mini-cart-drawer__title {
    color: #A080D8;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.4;
}

/* ========== LISTA DE ITENS ========== */
.spz-mini-cart-items {
    margin-bottom: 15px;
    overflow-y: auto;
    max-height: 60vh;
    flex: 1 1 auto;
}

/* Scrollbar customizada (desktop) */
.spz-mini-cart-items::-webkit-scrollbar {
    width: 6px;
}

.spz-mini-cart-items::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.spz-mini-cart-items::-webkit-scrollbar-thumb {
    background: rgba(160, 128, 216, 0.5);
    border-radius: 3px;
}

.spz-mini-cart-items::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 128, 216, 0.8);
}

/* Firefox */
.spz-mini-cart-items {
    scrollbar-width: thin;
    scrollbar-color: rgba(160, 128, 216, 0.5) rgba(255, 255, 255, 0.1);
}

/* ========== ITEM INDIVIDUAL ========== */
.spz-mini-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-right: 5px;
}

.spz-mini-cart-item__info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: 15px;
}

.spz-mini-cart-item__name {
    color: #FFFFFF;
    font-size: 16px;
    flex: 1;
}

.spz-mini-cart-item__price {
    color: #A080D8;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

/* ========== BOTÃO REMOVER (X) ========== */
.spz-mini-cart-item__remove {
    background: transparent;
    border: none;
    color: #FF6B6B;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.spz-mini-cart-item__remove:hover {
    color: #FF4444;
}

/* ========== TOTAL ========== */
.spz-mini-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 2px solid #A080D8;
    margin-bottom: 15px;
}

.spz-mini-cart-total__label {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 600;
}

.spz-mini-cart-total__value {
    color: #A080D8;
    font-size: 20px;
    font-weight: 700;
}

/* ========== AÇÕES ========== */
.spz-mini-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* ========== LINK FECHAR ========== */
.spz-mini-cart-link-close {
    color: #A080D8;
    font-size: 16px;
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.spz-mini-cart-link-close:hover {
    color: #8A60C8;
    text-decoration: underline;
}

/* ========== BOTÃO PAGAR ========== */
.spz-mini-cart-btn-checkout {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
    background: #A080D8;
    color: #1E1E1E;
    white-space: nowrap;
    flex: 1;
}

.spz-mini-cart-btn-checkout:hover {
    background: #8A60C8;
}

/* ========== BOTÃO IR À LOJA (VAZIO) ========== */
.spz-mini-cart-btn-shop {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
    background: #A080D8;
    color: #1E1E1E;
    width: 100%;
    display: none;
}

.spz-mini-cart-btn-shop:hover {
    background: #8A60C8;
}

/* ========== ESTADO VAZIO ========== */
.spz-mini-cart-wrapper.is-empty .spz-mini-cart-items,
.spz-mini-cart-wrapper.is-empty .spz-mini-cart-total,
.spz-mini-cart-wrapper.is-empty .spz-mini-cart-actions {
    display: none;
}

.spz-mini-cart-wrapper.is-empty .spz-mini-cart-drawer__title {
    margin-bottom: 20px;
}

.spz-mini-cart-wrapper.is-empty .spz-mini-cart-btn-shop {
    display: block;
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    /* Drawer centralizado com margem lateral */
    .spz-mini-cart-drawer {
        width: calc(100vw - 30px) !important;
        max-width: none !important;
        margin: 0 auto !important;
    }
    
    /* Esconder scrollbar no mobile */
    .spz-mini-cart-items::-webkit-scrollbar {
        display: none;
    }

    .spz-mini-cart-items {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    /* Ajustes de fonte */
    .spz-mini-cart-drawer__title {
        font-size: 16px;
    }
    
    .spz-mini-cart-item__name,
    .spz-mini-cart-item__price {
        font-size: 14px;
    }
    
    .spz-mini-cart-total__label,
    .spz-mini-cart-total__value {
        font-size: 16px;
    }
    
    .spz-mini-cart-link-close {
        font-size: 14px;
    }
    
    .spz-mini-cart-btn-checkout,
    .spz-mini-cart-btn-shop {
        font-size: 14px;
        padding: 10px 15px;
    }
}