* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #f5f5f7;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 480px;
}

/* Loading */
.loading {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error */
.error {
    background: white;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.error-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.error h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.error p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
    white-space: pre-line;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.error button:hover {
    background: #5568d3;
}

/* Etiqueta */
.etiqueta {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.etiqueta-header {
    background: #d1d1d6;
    padding: 30px 20px 20px;
    text-align: center;
    border-bottom: 1px solid #e8e8e8;
}

.empresa-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logo-img {
    max-width: 140px;
    max-height: 70px;
    object-fit: contain;
}

.empresa-logo h1 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
}

.producto-info {
    padding: 30px 25px;
}

.producto-nombre {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
    line-height: 1.3;
}

.producto-descripcion {
    font-size: 15px;
    color: #86868b;
    line-height: 1.5;
}

.codigo-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.codigo-info .label {
    color: #95a5a6;
    font-weight: 600;
}

.codigo-info .value {
    color: #34495e;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.precio-section {
    padding: 35px 25px;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
}

.precio-principal {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 8px;
}

.moneda {
    font-size: 36px;
    font-weight: 700;
    color: #1d1d1f;
    margin-right: 4px;
    margin-top: 8px;
}

.precio {
    font-size: 64px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1;
}

.precio-detalle {
    font-size: 15px;
    color: #86868b;
}

.unidad {
    font-weight: 400;
}

.detalles-adicionales {
    padding: 20px 25px;
    background: white;
    border-bottom: 1px solid #e8e8e8;
}

.detalle-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 15px;
}

.detalle-item .label {
    color: #86868b;
    font-weight: 500;
}

.detalle-item .value {
    color: #1d1d1f;
    font-weight: 600;
}

.etiqueta-footer {
    padding: 30px 25px;
    background: white;
}

.barcode {
    text-align: center;
    margin-bottom: 20px;
}

.barcode svg {
    max-width: 100%;
    height: 50px;
}

.barcode-text {
    font-family: 'SF Mono', 'Courier New', monospace;
    font-size: 13px;
    color: #86868b;
    margin-top: 12px;
    font-weight: 500;
}

.fecha-actualizacion {
    text-align: center;
    font-size: 11px;
    color: #a1a1a6;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .etiqueta-header {
        padding: 25px 20px 15px;
    }

    .logo-img {
        max-width: 120px;
        max-height: 60px;
    }

    .empresa-logo h1 {
        font-size: 13px;
    }

    .producto-info {
        padding: 25px 20px;
    }

    .producto-nombre {
        font-size: 22px;
    }

    .producto-descripcion {
        font-size: 14px;
    }

    .precio-section {
        padding: 30px 20px;
    }

    .precio {
        font-size: 52px;
    }

    .moneda {
        font-size: 30px;
        margin-top: 6px;
    }

    .precio-detalle {
        font-size: 14px;
    }

    .detalles-adicionales {
        padding: 18px 20px;
    }

    .detalle-item {
        font-size: 14px;
    }

    .etiqueta-footer {
        padding: 25px 20px;
    }
}
