/**
 * Estilos do Carrinho e Checkout Nuvemshop
 * Pulseira Salva Vidas
 */

/* Badge do Carrinho */
.cart-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF5757;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}

/* Modal do Carrinho */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-modal.active {
    display: flex;
    opacity: 1;
}

.cart-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.cart-modal__content {
    position: relative;
    margin-left: auto;
    background: white;
    width: 100%;
    max-width: 450px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Header do Modal */
.cart-modal__header {
    padding: 20px 25px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-modal__header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

.cart-modal__close {
    background: none;
    border: none;
    font-size: 3rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.cart-modal__close:hover {
    color: #000;
}

/* Body do Modal */
.cart-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.cart-empty p {
    font-size: 1.6rem;
    margin: 0;
}

/* Itens do Carrinho */
.cart-item {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:first-child {
    padding-top: 0;
}

.cart-item__image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.cart-item__details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item__details h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.cart-item__details p {
    margin: 0;
    font-size: 1.3rem;
    color: #666;
}

.cart-item__quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 5px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qty-btn:hover {
    border-color: #333;
    background: #f9f9f9;
}

.cart-item__quantity span {
    font-size: 1.4rem;
    font-weight: 500;
    min-width: 30px;
    text-align: center;
}

.cart-item__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.cart-item__price p {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: #333;
}

.cart-item__remove {
    background: none;
    border: none;
    color: #ff4444;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.cart-item__remove:hover {
    color: #cc0000;
    text-decoration: underline;
}

/* Footer do Modal */
.cart-modal__footer {
    padding: 25px;
    border-top: 2px solid #e5e5e5;
    background: #fafafa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 600;
}

.cart-total__price {
    color: #FF5757;
    font-size: 2.2rem;
}

.cart-modal__checkout-btn {
    width: 100%;
    padding: 18px;
    background: #FF5757;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-modal__checkout-btn:hover {
    background: #e64545;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 87, 87, 0.3);
}

/* Notificações */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.cart-notification.active {
    opacity: 1;
    transform: translateY(0);
}

.cart-notification--error {
    background: #ef4444;
}

/* Seletor de Variantes */
.variant-selector {
    margin: 20px 0;
}

.variant-selector__label {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #333;
}

.variant-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.variant-option {
    position: relative;
}

.variant-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.variant-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    padding: 15px 10px;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 500;
    transition: all 0.3s;
    background: white;
    text-align: center;
    line-height: 1.4;
}

.variant-option label strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.6rem;
    font-weight: 700;
}

.variant-option label span {
    color: #666;
    font-size: 1.4rem;
    font-weight: 500;
}

.variant-option input[type="radio"]:checked + label {
    border-color: #FF5757;
    background: #fff5f5;
    color: #FF5757;
    box-shadow: 0 4px 12px rgba(255, 87, 87, 0.2);
    transform: translateY(-2px);
}

.variant-option input[type="radio"]:checked + label span {
    color: #FF5757;
}

.variant-option label:hover {
    border-color: #FF5757;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .cart-modal__content {
        max-width: 100%;
    }
    
    .cart-item {
        flex-wrap: wrap;
    }
    
    .cart-item__image {
        width: 80px;
        height: 80px;
    }
    
    /* Variantes em mobile */
    .variant-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .variant-option label {
        min-height: 75px;
        padding: 12px 8px;
    }
    
    .variant-option label strong {
        font-size: 1.5rem;
        font-weight: 700;
    }
    
    .variant-option label span {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .variant-options {
        grid-template-columns: 1fr;
    }
    
    .variant-option label {
        min-height: 65px;
    }
}

/* Scrollbar customizada */
.cart-modal__body::-webkit-scrollbar {
    width: 8px;
}

.cart-modal__body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-modal__body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.cart-modal__body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

