/* Estrutura Base */
.modal-overlay { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(4px);
    z-index: 9999; 
    justify-content: center; 
    align-items: center; 
}

.modal-content { 
    background: #fff; 
    width: 95%; 
    max-width: 480px; 
    max-height: 85vh; 
    border-radius: 20px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
}

/* Header */
.modal-product-header { position: relative; display: flex; flex-direction: column; }
.modal-header-img { position: relative; height: 200px; width: 100%; flex-shrink: 0; }
.modal-header-img img { width: 100%; height: 100%; object-fit: cover; }
.modal-product-info { padding: 15px 20px; border-bottom: 1px solid #eee; }

.btn-close-modal { 
    position: absolute; 
    top: 15px; right: 15px; 
    background: #fff; 
    border: none; 
    border-radius: 50%; 
    width: 32px; height: 32px; 
    font-weight: bold; 
    cursor: pointer; 
    z-index: 10; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Corpo e Adicionais */
.modal-body { flex: 1; overflow-y: auto; background: #fff; }

.section-title { 
    background: #f4f4f4; 
    padding: 10px 20px; 
    font-weight: bold; 
    font-size: 0.85rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: #333;
    text-transform: uppercase;
}

.section-title small { 
    background: #e63946; 
    color: #fff; 
    padding: 2px 8px; 
    border-radius: 10px; 
    font-size: 0.7rem; 
    text-transform: none;
}

.additional-row { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 12px 20px; 
    border-bottom: 1px solid #f5f5f5; 
}

.add-left { display: flex; align-items: center; gap: 12px; }

.add-img-thumb { 
    width: 48px; height: 48px; 
    border-radius: 10px; 
    object-fit: cover; 
    border: 1px solid #f0f0f0;
}

.add-name strong { font-size: 14px; color: #333; display: block; }
.add-composition { 
    font-size: 11px; color: #777; 
    font-style: italic; margin-top: 2px; 
    line-height: 1.2; 
}

/* CAMPO DE OBSERVAÇÕES */
.modal-obs-container {
    padding: 15px 20px;
    border-top: 1px solid #f5f5f5;
    background: #fff;
}

.modal-obs-container label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    color: #444;
    margin-bottom: 8px;
}

#modal-observation {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    background: #fdfdfd;
}

#modal-observation:focus {
    border-color: #e63946;
    background: #fff;
}

/* Footer e Seletores */
.modal-footer { 
    padding: 15px 20px; 
    border-top: 1px solid #eee; 
    display: flex; gap: 10px; 
    align-items: center; 
}

.product-qty-selector { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    background: #f0f0f0; 
    padding: 8px 15px; 
    border-radius: 10px; 
}

.product-qty-selector button { 
    border: none; background: none; 
    font-size: 1.2rem; font-weight: bold; 
    color: #e63946; cursor: pointer; 
}

.qty-selector { 
    display: flex; align-items: center; 
    gap: 8px; background: #f0f0f0; 
    padding: 3px 8px; border-radius: 20px; 
}

.qty-selector button { 
    border: none; background: #fff; 
    color: #e63946; width: 26px; height: 26px; 
    border-radius: 50%; font-weight: bold; 
    cursor: pointer; 
}

.btn-confirm-add { 
    flex: 1; background: #e63946; 
    color: #fff; border: none; 
    padding: 12px; border-radius: 10px; 
    font-weight: bold; font-size: 1rem; 
    cursor: pointer; 
}

/* Ajustes Mobile */
@media (max-width: 480px) {
    .modal-product-header {
        flex-direction: row;
        align-items: center;
        padding: 15px;
        gap: 15px;
        border-bottom: 1px solid #eee;
    }
    .modal-header-img { width: 70px; height: 70px; }
    .modal-header-img img { border-radius: 12px; }
    .modal-product-info { padding: 0; border-bottom: none; flex: 1; }
    .modal-product-info h2 { font-size: 1.1rem; margin: 0; }
    .btn-close-modal { top: 10px !important; right: 10px !important; }
}