/* assets/css/cart-notification.css */

/* ========== CONTAINER WRAPPER - FIXA NO TOPO ========== */
.spz-cart-notification-wrapper {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 99999;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    /* Margem controlável via Elementor */
}

.spz-cart-notification-wrapper.is-visible {
    transform: translateX(-50%) translateY(20px);
}

/* ========== CONTAINER PRINCIPAL ========== */
.spz-cart-notification {
    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;
    /* Largura e padding controláveis via Elementor */
}

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

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

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

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

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

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

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

/* ========== CONTROLE DE VISIBILIDADE ========== */
/* Esconder "+X itens" quando FECHADO */
.spz-cart-notification-wrapper:not(.is-expanded) .spz-cart-item--hidden {
    display: none !important;
}

/* Esconder X do primeiro item quando FECHADO */
.spz-cart-notification-wrapper:not(.is-expanded) .spz-cart-item--first .spz-cart-item__remove {
    display: none !important;
}

/* Mostrar tudo quando ABERTO */
.spz-cart-notification-wrapper.is-expanded .spz-cart-item--hidden {
    display: flex !important;
}

.spz-cart-notification-wrapper.is-expanded .spz-cart-item--first .spz-cart-item__remove {
    display: flex !important;
}

/* ========== ITEM INDIVIDUAL ========== */
.spz-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-right: 5px;
    /* Padding e margem controláveis via Elementor */
}

.spz-cart-item__info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    gap: 15px;
    /* Gap controlável via Elementor */
}

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

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

/* ========== BOTÃO REMOVER (X) ========== */
.spz-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;
    /* Padding, margem, border, border-radius controláveis via Elementor */
}

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

/* ========== RESUMO (+X ITENS) ========== */
.spz-cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: #FFFFFF;
    font-size: 16px;
    border-bottom: 1px solid rgba(160, 128, 216, 0.2);
    margin-bottom: 15px;
}

/* Esconder resumo quando ABERTO */
.spz-cart-notification-wrapper.is-expanded .spz-cart-summary {
    display: none !important;
}

.spz-cart-summary__text {
    flex: 1;
}

.spz-cart-summary__price {
    color: #A080D8;
    font-weight: 600;
}

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

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

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

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

/* ========== LINK ABRIR/FECHAR ========== */
.spz-cart-link-toggle {
    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;
    /* Padding controlável via Elementor */
}

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

/* ========== BOTÃO PAGAR ========== */
.spz-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;
    /* Cores, tipografia, border, border-radius, padding controláveis via Elementor */
}

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

/* ========== BOTÃO IR À LOJA (VAZIO) ========== */
.spz-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;
    /* Cores, tipografia, border, border-radius, padding controláveis via Elementor */
}

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

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

.spz-cart-notification-wrapper.is-empty .spz-cart-notification__title {
    margin-bottom: 20px;
}

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

/* ========== ESCONDER NOTIFICAÇÕES DO WOOCOMMERCE ========== */
a.added_to_cart.wc-forward {
    display: none !important;
}

.woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-message,
div.woocommerce-message {
    display: none !important;
}

.single_add_to_cart_button.added::after,
.single_add_to_cart_button.added::before {
    display: none !important;
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    /* Wrapper centralizado */
    .spz-cart-notification-wrapper {
        left: 50%;
        transform: translateX(-50%) translateY(-100%);
        width: 100vw;
    }

    .spz-cart-notification-wrapper.is-visible {
        transform: translateX(-50%) translateY(20px);
    }

    /* Notificação com 15px de respiro em cada lado */
    .spz-cart-notification {
        width: calc(100vw - 28px) !important;
        max-width: none !important;
        margin: 0 auto !important;
    }
    
    /* Esconder scrollbar no mobile */
    .spz-cart-items::-webkit-scrollbar {
        display: none;
    }

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