* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.form-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section h1 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #333;
}

.form-select {
    background-color: white;
    cursor: pointer;
}

.btn-gerar {
    width: 100%;
    padding: 15px;
    background: #333;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.btn-gerar:hover {
    background: #555;
}

.preview-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.etiqueta-preview {
    display: flex;
    justify-content: center;
}

/* Estilo da Etiqueta */
.etiqueta {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: width 0.3s, height 0.3s;
}

.header-etiqueta {
    background: #000;
    padding: 4px;
    text-align: center;
}

.logo-text {
    color: white;
    font-weight: bold;
    font-size: 0.7rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.conteudo-etiqueta {
    padding: 6px;
}

.descricao {
    margin-bottom: 2px;
}

.texto-descricao {
    font-size: 0.6rem;
    color: #333;
    font-weight: 600;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.2em;
    margin-bottom: 2px;
}

.barcode-container {
    display: flex;
    justify-content: center;
    margin: 3px 0;
    padding: 2px 0;
    border-radius: 3px;
}

.barcode-container svg {
    max-width: 88%;
    height: auto;
}

.codigo-numerico {
    text-align: center;
    font-size: 0.6rem;
    font-weight: bold;
    color: #333;
    margin-top: 2px;
    letter-spacing: 0.4px;
}

/* Área de Impressão (oculta na tela) */
.area-impressao {
    display: none;
}

/* Estilos para Impressão */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container,
    .form-section,
    .preview-section {
        display: none;
    }
    
    .area-impressao {
        display: block;
    }
    
    .etiqueta-impressao {
        background: white;
        border: 1px solid #ddd;
        border-radius: 0;
        overflow: hidden;
        page-break-inside: avoid;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    .etiqueta-impressao .header-etiqueta {
        background: #000;
        padding: 4px;
        text-align: center;
    }
    
    .etiqueta-impressao .logo-text {
        color: white;
        font-weight: bold;
        font-size: 0.75rem;
        letter-spacing: 0.8px;
        text-transform: uppercase;
    }
    
    .etiqueta-impressao .conteudo-etiqueta {
        padding: 6px;
    }
    
    .etiqueta-impressao .texto-descricao {
        font-size: 0.65rem;
        color: #333;
        font-weight: 600;
        font-family: Arial, Helvetica, sans-serif;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        max-height: 2.4em;
    }
    
    .etiqueta-impressao .barcode-container {
        margin: 3px 0;
        padding: 2px 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .etiqueta-impressao .barcode-container svg {
        max-width: 85% !important;
        height: auto;
    }
    
    .etiqueta-impressao .codigo-numerico {
        font-size: 0.65rem;
        font-weight: bold;
        color: #333;
        margin-top: 2px;
    }
    
    @page {
        margin: 5mm;
        size: A4 portrait;
    }
    
    /* Layout de 2 colunas para impressão */
    .area-impressao > div {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5mm !important;
        padding: 5mm !important;
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
}
