/* Alert message styles */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #fff;
    font-weight: bold;
}

.alert-warning {
    background-color: #f0ad4e;
    border: 1px solid #eea236;
}

/* Carrinho de compras styles */
.cart-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}
.cart-table th, .cart-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.cart-total {
    text-align: center; /* Center the total on desktop too */
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-sizing: border-box;
    max-width: 400px; /* Limit width for better appearance */
    margin-left: auto;
    margin-right: auto;
}
.quantity-input {
    width: 60px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}
.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.product-name {
    font-weight: bold;
    color: var(--text-color);
}

@media (max-width: 768px) {
    body, html {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        overflow-x: hidden; /* Remover a barra de rolagem horizontal */
    }
    .container {
        width: 100%;
        padding: 10px; /* Reduced padding to save space */
        box-sizing: border-box;
        text-align: center; /* Center all text content */
        display: flex;
        flex-direction: column;
        align-items: center; /* Center children horizontally */
    }

    .cart-table tr, .cart-total, .cart-actions {
        margin-left: auto;
        margin-right: auto;
    }
    .product-image {
        width: 100%; /* Full width for mobile */
        max-width: 80px; /* Limit maximum size */
        height: auto; /* Maintain aspect ratio */
        object-fit: cover;
        border-radius: 4px;
        margin-bottom: 10px; /* Add space below image */
    }
    .cart-table, .cart-table th, .cart-table td {
        display: block; /* Make table responsive */
        width: 100%;
        overflow-x: hidden; /* Remove horizontal scroll */
        box-sizing: border-box;
    }

    .cart-table {
        display: flex;
        flex-direction: column;
        align-items: center; /* Center all rows horizontally */
        width: 100%;
    }

    .cart-table tr {
        margin-bottom: 20px; /* More space between items */
        padding: 15px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Center content vertically */
        width: 90%; /* Limit width for better appearance */
        max-width: 400px; /* Maximum width for larger screens */
    }
    .cart-table tr {
        margin-bottom: 15px;
        padding: 10px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .cart-table th, .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        width: 100%;
    }
    .cart-table thead {
        display: none; /* Hide table header on small screens */
    }
    .cart-table th::before,
    .cart-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 10px;
        min-width: 60px; /* Reduce minimum width for better spacing */
        flex-shrink: 0; /* Prevent shrinking */
    }
    .cart-total {
        text-align: center; /* Center the total */
        margin-top: 20px;
        padding: 10px;
        width: 100%;
        max-width: 400px; /* Limit width for better appearance */
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }
    .cart-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 20px;
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .btn-continue, .btn-primary {
        margin: 10px 0;
        width: 80%; /* Make buttons wider for better touch target */
        max-width: 300px; /* Limit maximum width */
        box-sizing: border-box;
    }
    .btn-continue, .btn-primary {
        margin: 10px 0;
        width: 100%;
        max-width: 300px; /* Largura máxima para os botões */
        box-sizing: border-box;
    }

    /* Additional responsive adjustments */
    .quantity-input {
        width: 40%; /* Usar porcentagem para a largura do input de quantidade */
        max-width: 100px; /* Definir uma largura máxima */
    }
    .quantity-controls {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px; /* Space between elements */
        margin-top: 10px; /* Add space above controls */
        width: 100%; /* Full width for proper centering */
    }
    .quantity-btn {
        width: 40px; /* Ajustar a largura dos botões de controle */
        height: 40px; /* Ajustar a altura dos botões de controle */
    }
    .product-name {
        font-size: 16px; /* Reduzir o tamanho do nome do produto */
        width: 50%; /* Usar porcentagem para a largura do nome do produto */
    }

    /* Further adjustments to ensure full width usage */
    .cart-table td, .cart-table th {
        flex-wrap: wrap;
    }
    .product-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
    }

    /* Ensure product image is centered */
    .product-image {
        margin-left: auto; /* Center horizontally */
        margin-right: auto; /* Center horizontally */
    }

    .product-info .product-name {
        margin-top: 5px; /* Space between image and name */
        font-size: 16px; /* Slightly larger for better readability */
    }

    .stock-warning {
        color: #dc3545;
        font-size: 0.8em;
        margin-top: 5px;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .stock-warning.show {
        opacity: 1;
        display: block;
    }
    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    .modal-content {
        background: white;
        padding: 20px;
        border-radius: 8px;
        text-align: center;
        max-width: 400px;
        width: 90%;
    }

    .modal-buttons {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }

    .modal-button {
        padding: 8px 16px;
        border-radius: 4px;
        cursor: pointer;
        border: none;
    }

    .modal-button-confirm {
        background: #dc3545;
        color: white;
    }

    .modal-button-cancel {
        background: #6c757d;
        color: white;
    }
}

/* Modal styles for desktop */
@media (min-width: 769px) {
    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    .modal-content {
        background: white;
        padding: 20px;
        border-radius: 8px;
        text-align: center;
        max-width: 400px;
        width: 90%;
    }

    .modal-buttons {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }

    .modal-button {
        padding: 8px 16px;
        border-radius: 4px;
        cursor: pointer;
        border: none;
    }

    .modal-button-confirm {
        background: #dc3545;
        color: white;
    }

    .modal-button-cancel {
        background: #6c757d;
        color: white;
    }
}

.quantity-controls {
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center;
    gap: 5px;
    width: 100%; /* Full width for proper centering */
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.quantity-btn:hover {
    background: var(--primary-color-dark, #722F37);
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    margin-left: auto; /* Center horizontally */
    margin-right: auto; /* Center horizontally */
}

/* Remover setinhas do input number */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input[type=number] {
    -moz-appearance: textfield;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Estilos para o botão "continuar comprando" */
.btn-continue {
    background: #2ecc71; /* Verde mais claro */
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-primary {
    background: #2ecc71 !important; /* Verde mais claro */
    color: white !important;
    padding: 12px 24px;
    border-radius: 25px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
}

.btn-primary:hover {
    background: #27ae60 !important; /* Verde um pouco mais escuro no hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Estilos para o botão "remover item" */
.btn-secondary {
    background: #dc3545; /* Red color for remove button */
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #c82333; /* Darker red on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
