/* Container principal do calculador */
.calculador-container { background-color: #ffffff; border: 1px solid #e9e9e9; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

/* Caixa 1: Seleção Primária de Tipo de Impressão */
.tipo-produto-container { background-color: #f5f7fa; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.tipo-produto-container > label { font-weight: bold; display: block; margin-bottom: 15px; color: #333; font-size: 1em; text-align: center; }
.tipo-produto-options { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.tipo-produto-options label { padding: 15px; border: 2px solid #ccc; border-radius: 8px; text-align: center; cursor: pointer; font-weight: bold; transition: all 0.2s ease-in-out; background-color: #fff; margin-bottom: 0; }
.tipo-produto-options input[type="radio"] { display: none; }
.tipo-produto-options input[type="radio"]:checked + label { background-color: #e8e0f5; border-color: #6a15e6; color: #6a15e6; box-shadow: 0 0 10px rgba(106, 21, 230, 0.2); }

/* Caixa 2: Opções de Configuração */
.opcoes-container { background-color: #f5f7fa; padding: 20px; border-radius: 8px; margin-bottom: 20px; display: none; }
/* ATUALIZADO: Grid responsivo para evitar sobreposição */
.opcoes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; } 
.calculador-campo label { font-weight: bold; display: block; margin-bottom: 8px; color: #333; font-size: 0.9em; }
.calculador-container select, .opcoes-container input[type="text"] { width: 100%; padding: 10px; border-radius: 5px; border: 1px solid #ccc; background-color: white; box-sizing: border-box; }
.opcoes-container input[type="text"]:disabled { background-color: #eee; }

/* Seção de Encadernação */
.binding-section { grid-column: 1 / -1; }
.binding-options { display: flex; flex-wrap: wrap; gap: 10px 20px; background-color: white; padding: 10px; border: 1px solid #ccc; border-radius: 5px; }
.binding-options label { display: flex; align-items: center; gap: 5px; font-weight: normal; margin-bottom: 0; cursor: pointer; }
.binding-options input[type="radio"] { margin-top: -2px; }

/* Caixa 3: Botões de Upload */
.upload-container { background-color: #f5f7fa; padding: 20px; border-radius: 8px; margin-bottom: 20px; display: none; }
.upload-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.upload-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: white !important; padding: 12px 15px; border-radius: 5px; cursor: pointer; transition: background-color 0.3s ease; width: 100%; text-align: center; box-sizing: border-box; font-weight: bold; border: none; }
.upload-btn svg { stroke: white; }
#meu_upload_pdf_label { background-color: #0073e6; }
#meu_upload_pdf_label:hover { background-color: #005bb8; }
#meu_upload_imagens_label { background-color: #28a745; }
#meu_upload_imagens_label:hover { background-color: #218838; }

/* Caixa 4: Lista de Arquivos */
#file-list-container { margin-top: 20px; font-size: 0.9em; }
.file-item { background-color: #fff; border: 1px solid #e0e0e0; padding: 8px 12px; border-radius: 5px; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; transition: background-color 0.2s ease; }
.file-item.bind-active { background-color: #f0e6ff; border-left: 3px solid #6a15e6; }
.file-item-info { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.file-item .file-name { color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .file-pages { color: #555; font-weight: bold; white-space: nowrap; background-color: #f0f0f0; padding: 2px 6px; border-radius: 4px; font-size: 0.85em;}
.file-item .spinner { width: 16px; height: 16px; border: 2px solid #f3f3f3; border-top: 2px solid #0073e6; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.bind-checkbox-wrapper { display: none; margin-right: 10px; }
.remove-file-btn { background-color: #e62e2e; color: white; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-weight: bold; display: flex; align-items: center; justify-content: center; margin-left: 10px; padding: 0; line-height: 1; flex-shrink: 0; }
.remove-file-btn:hover { background-color: #b82525; }

/* Caixa 5: Prévia do Preço */
#preco-preview-container { background-color: #e6f7ff; border: 2px solid #91d5ff; border-radius: 8px; padding: 20px; text-align: center; margin-top: 20px; transition: all 0.3s ease; }
#preco-preview-container .price-placeholder { color: #555; font-style: italic; }
#preco-preview-container .price-total { font-size: 2.2em; font-weight: bold; color: #0050b3; }
#preco-preview-container .price-details { display: block; margin-top: 5px; color: #333; font-size: 0.9em;}

@media (max-width: 600px) {
    .calculador-container, .tipo-produto-container, .opcoes-container, .upload-container { padding: 15px; }
    .tipo-produto-options, .opcoes-grid, .upload-grid { grid-template-columns: 1fr; gap: 15px; }
    #preco-preview-container .price-total { font-size: 1.8em; }
    .upload-btn { padding: 12px 10px; font-size: 0.95em; }
}