﻿
/* Container principal do produto */
.produto-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* Área da imagem */
.produto-imagem {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .produto-imagem img {
        width: 280px;
        height: 280px;
        border-radius: 16px;
        object-fit: contain;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        transition: transform 0.3s ease;
    }

/* Container das informações do produto */
.produto-info-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0; /* Permite que o conteúdo quebre corretamente */
}

/* Informações básicas do produto */
.produto-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

    .produto-info h4 {
        margin: 0;
        font-size: 1.75rem;
        font-weight: 700;
        color: #2c3e50;
        line-height: 1.3;
        word-wrap: break-word;
    }

    .produto-info p {
        margin: 0;
        font-size: 1.05rem;
        color: #64748b;
        line-height: 1.5;
    }

/* Área de preço e quantidade */
.produto-preco-quantidade {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.produto-preco {
    font-size: 1.75rem;
    font-weight: 800;
    color: #27ae60;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(39, 174, 96, 0.2);
}

/* Estilo base da descrição – até 4 linhas */
#mercadoriaInfo {
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: 5.6em;
}


.adicional-item, .sabor-item, .observacao-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin: 0.5rem 0;
    gap: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.adicional-info, .sabor-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

/* OBSERVAÇÕES - LAYOUT CORRIGIDO */
.observacao-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    padding-right: 0.5rem;
}

.adicional-nome, .sabor-nome, .observacao-nome {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    line-height: 1.4;
}

.preco-adicional, .preco-sabor {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.preco-proporcional {
    color: #f7654b;
    font-weight: 600;
}


/* 
|----------------------------------------------------------------------------
| 7. Controles de Quantidade
|----------------------------------------------------------------------------
*/
.quantidade-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: 110px;
    flex-shrink: 0;
}

.quantidade-valor, .produto-quantidade-valor {
    font-size: 1.1rem;
    font-weight: 700;
    width: 35px;
    text-align: center;
    color: #2c3e50;
}

.btn-menos, .btn-mais, .produto-btn-menos, .produto-btn-mais {
    background: linear-gradient(135deg, #f7654b 0%, #e74c3c 100%);
    color: white;
    border: none;
    padding: 0.375rem;
    border-radius: 6px;
    font-size: 0.875rem;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

    .btn-menos:disabled, .produto-btn-menos:disabled {
        background: #cbd5e1;
        cursor: not-allowed;
        transform: none;
    }

.quantidade-preco, .produto-quantidade-preco, .quantidade {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.produto-quantidade {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* 
|----------------------------------------------------------------------------
| 8. Grupos e Validação
|----------------------------------------------------------------------------
*/
.grupo-adicional, .grupo-sabor {
    margin-bottom: 0.5rem;
}

    .grupo-adicional h5 {
        font-weight: 700;
        color: #2c3e50;
        margin-bottom: 0.75rem;
    }

.grupo-header {
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .grupo-header:hover {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    }

    .grupo-header h6 {
        font-weight: 600;
        margin: 0;
        color: #2c3e50;
    }

.btn-toggle-group {
    transition: all 0.3s ease;
    color: #64748b;
    font-size: 1.25rem;
}

    .btn-toggle-group:hover {
        color: #f7654b;
    }

.grupo-invalido {
    border: 2px solid #e74c3c;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    border-radius: 8px;
    padding: 0.5rem;
    animation: shake 0.5s ease-in-out;
}

/* 
|----------------------------------------------------------------------------
| 9. Botões Principais
|----------------------------------------------------------------------------
*/
.btn-adicionar {
    background: linear-gradient(135deg, #f7654b 0%, #e74c3c 100%);
    color: white;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    width: 100%;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .btn-adicionar:hover {
        background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    }

/* 
|----------------------------------------------------------------------------
| 10. Campos Especiais
|----------------------------------------------------------------------------
*/
.produto-quantidade.fracionado {
    min-width: 160px;
    position: relative;
}

.produto-quantidade-input {
    width: 80px;
    text-align: center;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
    background: white;
}

    .produto-quantidade-input:focus {
        border-color: #f7654b;
        outline: none;
        box-shadow: 0 0 0 3px rgba(247, 101, 75, 0.2);
    }

.produto-quantidade.fracionado::after {
    content: 'kg';
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin-left: 0.25rem;
}

/* 
|----------------------------------------------------------------------------
| 11. OBSERVAÇÕES COM CHECKBOX
|----------------------------------------------------------------------------
*/
.observacao-item {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.875rem;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    flex-direction: row;
    text-align: left;
}

    .observacao-item[data-observacao-check="true"] {
        background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
        border-color: #27ae60;
    }

        .observacao-item[data-observacao-check="true"] .observacao-nome {
            color: #27ae60;
            font-weight: 700;
        }

    .observacao-item .form-check {
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        min-width: 24px;
        height: 24px;
        margin-top: 0.125rem;
    }

    .observacao-item .form-check-input {
        width: 20px;
        height: 20px;
        margin: 0;
        cursor: pointer;
        accent-color: #27ae60;
        flex-shrink: 0;
    }


/* 
|----------------------------------------------------------------------------
| 12. RESPONSIVIDADE MELHORADA
|----------------------------------------------------------------------------
*/

/* Tablets - 768px até 1024px */
@media (max-width: 1024px) {

    .produto-info h4 {
        font-size: 1.5rem;
    }

    .produto-preco {
        font-size: 1.5rem;
    }
}

/* Tablets pequenos - 640px até 768px */
@media (max-width: 768px) {
 
    /* Manter layout lado a lado em tablets */
    .produto-container {
        flex-direction: row;
        gap: 1rem;
    }

    .produto-imagem img {
        width: 200px;
        height: 200px;
    }

    .produto-info h4 {
        font-size: 1.4rem;
    }

    .produto-preco {
        font-size: 1.4rem;
    }
}

/* Mobile - 480px até 640px */
@media (max-width: 640px) {
    .modal-dialog {
        max-width: 100%;
        margin: 0.25rem auto;
    }

    .modal-body {
        padding: 0.75rem;
    }

    /* Mudar para layout vertical em mobile */
    .produto-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .produto-info h4 {
        font-size: 1.3rem;
        text-align: center;
    }

    .produto-preco-quantidade {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .produto-preco {
        font-size: 1.4rem;
    }

    .box-container {
        padding: 0.5rem 0.2rem;
    }

    .adicional-item, .sabor-item, .observacao-item {
        padding: 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .quantidade-preco, .produto-quantidade-preco, .quantidade {
        margin-left: 0;
        margin-top: 0.5rem;
        justify-content: flex-end;
    }
}

/* Mobile pequeno - 360px até 480px */
@media (max-width: 480px) {
    .produto-info h4 {
        font-size: 1.2rem;
    }

    .produto-preco {
        font-size: 1.3rem;
    }

    .btn-adicionar {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    .observacao-item {
        padding: 0.625rem;
        gap: 0.5rem;
    }

    .observacao-nome {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .observacao-item .form-check-input {
        width: 16px;
        height: 16px;
    }
}

/* Mobile muito pequeno - até 360px */
@media (max-width: 360px) {
    .modal {
        padding: 0.125rem !important;
    }

    .modal-header {
        padding: 0.5rem 0.75rem;
    }

    .produto-info h4 {
        font-size: 1.1rem;
    }

    .produto-preco {
        font-size: 1.2rem;
    }

    .observacao-item {
        padding: 0.5rem;
    }

    .observacao-nome {
        font-size: 0.85rem;
    }

    .observacao-item .form-check-input {
        width: 14px;
        height: 14px;
    }
}
