/* Estiliza a seção do carrinho */
.cart-section {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    background-color: var(--card-dark);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
    font-family: 'Poppins', sans-serif;
    color: var(--text-light);
    display: none;
    /* Alternar com JS */
    transition: var(--transition);
    position: fixed;
    top: 5%;
    /* Distância do topo para desktop */
    left: 50%;
    transform: translateX(-50%);
    /* Centraliza o carrinho no eixo horizontal */
    padding-top: env(safe-area-inset-top, 20px);
    /* Evita que o carrinho fique cortado pela parte superior */
    padding-bottom: env(safe-area-inset-bottom, 20px);
    /* Evita que o carrinho fique cortado pela parte inferior */
    overflow-y: auto;
    /* Permite rolar o conteúdo se necessário */
    z-index: 9999;
    /* Garante que o carrinho fique sobre outros elementos */
    height: 90vh;
}

/* Título do carrinho */
.cart-section h3 {
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-transform: uppercase;
}

/* Lista de itens no carrinho */
#cart-items {
    max-height: calc(100vh - 150px);
    /* Ajusta o espaço para os itens do carrinho */
    overflow-y: auto;
    padding-right: 5px;
}

/* Estilização de cada item */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    transition: var(--transition);
    gap: 10px;
    flex-wrap: wrap;
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-item h4 {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-light);
    flex-grow: 1;
}

.cart-item p {
    font-size: 14px;
    color: #ccc;
    margin: 0 10px;
}

/* Contêiner de botões */
.cart-item .quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: var(--border-radius);
}

/* Botões de controle de quantidade */
.cart-item button {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-item {
    background-color: green;
    color: white;
}

.add-item:hover {
    background-color: darkgreen;
}

.remove-quantity {
    background-color: orange;
    color: white;
}

.remove-quantity:hover {
    background-color: darkorange;
}

.remove-item {
    background-color: red;
    color: white;
}

.remove-item:hover {
    background-color: darkred;
}

/* Área de envio */
.cart-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

#cart_textarea {
    width: 100%;
    min-height: 60px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px;
    border-radius: var(--border-radius);
    resize: none;
}

.send-whatsapp {
    width: 100%;
    padding: 12px;
    background-color: var(--whatsapp-green);
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.send-whatsapp:hover {
    background-color: var(--whatsapp-dark);
    transform: scale(1.05);
}

.send-whatsapp:active {
    background-color: #075E54;
    transform: scale(0.98);
}

/* Responsividade para celular */
@media (max-width: 480px) {
    .cart-section {
        max-width: 100%;
        padding: 15px;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        transform: none;
        max-height: 100vh;

    }

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-item .quantity-controls {
        gap: 3px;
    }
}

/* Responsividade para tablets e desktops menores */
@media (max-width: 768px) {
    .cart-section {
        width: 100%;
        left: 0;
        right: 0;
        transform: none;
    }
}

/* Responsividade para desktops */
@media (min-width: 769px) {
    .cart-section {
        max-width: 420px;
        top: 5%;
        /* Ajuste da distância superior */
        left: 50%;
        /* Centraliza horizontalmente */
        transform: translateX(-50%);
        /* Garante que o carrinho fique centralizado */
        padding-top: 20px;
        /* Espaçamento do topo */
        max-height: 100vh;

    }
}


@media (max-width: 768px) {
    .cart-section {
        width: 100%;
        left: 0;
        right: 0;
        transform: none;
    }
}